relation_test.go 999 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestFollowers(t *testing.T) {
  8. convey.Convey("Followers", t, func() {
  9. rl, err := d.Followers(context.TODO(), 1, 2)
  10. convey.So(err, convey.ShouldBeNil)
  11. convey.So(rl, convey.ShouldNotBeNil)
  12. })
  13. }
  14. func TestFollowings(t *testing.T) {
  15. convey.Convey("Followings", t, func() {
  16. rl, err := d.Followings(context.TODO(), 1, 2)
  17. convey.So(err, convey.ShouldBeNil)
  18. convey.So(rl, convey.ShouldNotBeNil)
  19. })
  20. }
  21. func TestStat(t *testing.T) {
  22. var (
  23. c = context.Background()
  24. mid int64 = 2
  25. )
  26. convey.Convey("stat", t, func() {
  27. reply, err := d.Stat(c, mid)
  28. convey.So(err, convey.ShouldBeNil)
  29. convey.So(reply, convey.ShouldNotBeNil)
  30. })
  31. }
  32. func TestStats(t *testing.T) {
  33. var (
  34. c = context.Background()
  35. mids = []int64{2, 3}
  36. )
  37. convey.Convey("stats", t, func() {
  38. replys, err := d.Stats(c, mids)
  39. convey.So(err, convey.ShouldBeNil)
  40. convey.So(replys, convey.ShouldNotBeNil)
  41. })
  42. }