stat_test.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoDelStatCache(t *testing.T) {
  8. var (
  9. mid = int64(0)
  10. )
  11. convey.Convey("DelStatCache", t, func(ctx convey.C) {
  12. err := d.DelStatCache(mid)
  13. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  14. ctx.So(err, convey.ShouldBeNil)
  15. })
  16. })
  17. }
  18. func TestDaoFollowerAchieve(t *testing.T) {
  19. var (
  20. c = context.Background()
  21. mid = int64(0)
  22. follower = int64(0)
  23. )
  24. convey.Convey("FollowerAchieve", t, func(ctx convey.C) {
  25. d.FollowerAchieve(c, mid, follower)
  26. ctx.Convey("No return values", func(ctx convey.C) {
  27. })
  28. })
  29. }
  30. func TestDaoensureAllFollowerAchieve(t *testing.T) {
  31. var (
  32. c = context.Background()
  33. mid = int64(0)
  34. follower = int64(0)
  35. )
  36. convey.Convey("ensureAllFollowerAchieve", t, func(ctx convey.C) {
  37. d.ensureAllFollowerAchieve(c, mid, follower)
  38. ctx.Convey("No return values", func(ctx convey.C) {
  39. })
  40. })
  41. }
  42. func TestDaoSendMsg(t *testing.T) {
  43. var (
  44. c = context.Background()
  45. mid = int64(0)
  46. title = ""
  47. context = ""
  48. )
  49. convey.Convey("SendMsg", t, func(ctx convey.C) {
  50. err := d.SendMsg(c, mid, title, context)
  51. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  52. ctx.So(err, convey.ShouldBeNil)
  53. })
  54. })
  55. }