task_test.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package rpc
  2. import (
  3. "context"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestRpcFansCount(t *testing.T) {
  8. Convey("FansCount", t, WithMockRelation(t, func(d *Dao) {
  9. res, err := d.FansCount(context.TODO(), _Mids)
  10. So(err, ShouldBeNil)
  11. So(res, ShouldNotBeNil)
  12. }))
  13. }
  14. func TestRpcUserInfos(t *testing.T) {
  15. Convey("UserInfos", t, WithDao(t, func(d *Dao) {
  16. res, err := d.UserInfos(context.TODO(), _Mids)
  17. So(err, ShouldBeNil)
  18. So(res, ShouldNotBeNil)
  19. }))
  20. }
  21. func TestRpcProfile(t *testing.T) {
  22. Convey("Profile", t, WithMockAccount(t, func(d *Dao) {
  23. res, err := d.Profile(context.TODO(), _Mid)
  24. So(err, ShouldBeNil)
  25. So(res, ShouldBeNil)
  26. }))
  27. }
  28. func TestRpcInfo3(t *testing.T) {
  29. Convey("Info3", t, WithMockAccount(t, func(d *Dao) {
  30. res, err := d.Info3(context.TODO(), _Mid)
  31. So(err, ShouldBeNil)
  32. So(res, ShouldNotBeNil)
  33. }))
  34. }
  35. func TestRpcUpSpecial(t *testing.T) {
  36. Convey("UpSpecial", t, WithMockUp(t, func(d *Dao) {
  37. res1, err := d.UpSpecial(context.TODO(), _Mid)
  38. So(err, ShouldBeNil)
  39. So(res1, ShouldNotBeNil)
  40. res2, err := d.UpsSpecial(context.TODO(), _Mids)
  41. So(err, ShouldBeNil)
  42. So(res2, ShouldNotBeNil)
  43. res3, err := d.UpGroups(context.TODO())
  44. So(err, ShouldBeNil)
  45. So(res3, ShouldNotBeNil)
  46. }))
  47. }