relations_test.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/admin/main/relation/model"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestFollowers(t *testing.T) {
  9. convey.Convey("Followers", t, func() {
  10. rl, err := s.Followers(context.TODO(), &model.FollowersParam{
  11. Fid: 1,
  12. Mid: 2,
  13. })
  14. convey.So(err, convey.ShouldBeNil)
  15. convey.So(rl, convey.ShouldNotBeNil)
  16. })
  17. }
  18. func TestFollowings(t *testing.T) {
  19. convey.Convey("Followings", t, func() {
  20. rl, err := s.Followings(context.TODO(), &model.FollowingsParam{
  21. Fid: 1,
  22. Mid: 2,
  23. })
  24. convey.So(err, convey.ShouldBeNil)
  25. convey.So(rl, convey.ShouldNotBeNil)
  26. })
  27. }
  28. func TestStat(t *testing.T) {
  29. convey.Convey("stat", t, func() {
  30. rl, err := s.Stat(context.TODO(), &model.ArgMid{
  31. Mid: 2,
  32. })
  33. convey.So(err, convey.ShouldBeNil)
  34. convey.So(rl, convey.ShouldNotBeNil)
  35. })
  36. }
  37. func TestStats(t *testing.T) {
  38. convey.Convey("stats", t, func() {
  39. rl, err := s.Stats(context.TODO(), &model.ArgMids{
  40. Mids: []int64{2, 3},
  41. })
  42. convey.So(err, convey.ShouldBeNil)
  43. convey.So(rl, convey.ShouldNotBeNil)
  44. })
  45. }