redis_rct_test.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaokeyRecent(t *testing.T) {
  8. convey.Convey("keyRecent", t, func(ctx convey.C) {
  9. var (
  10. mid = int64(0)
  11. )
  12. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  13. p1 := keyRecent(mid)
  14. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  15. ctx.So(p1, convey.ShouldNotBeNil)
  16. })
  17. })
  18. })
  19. }
  20. func TestDaoRecentDM(t *testing.T) {
  21. convey.Convey("RecentDM", t, func(ctx convey.C) {
  22. var (
  23. c = context.Background()
  24. mid = int64(0)
  25. start = int64(0)
  26. end = int64(0)
  27. )
  28. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  29. testDao.RecentDM(c, mid, start, end)
  30. })
  31. })
  32. }
  33. func TestDaoTrimUpRecent(t *testing.T) {
  34. convey.Convey("TrimUpRecent", t, func(ctx convey.C) {
  35. var (
  36. c = context.Background()
  37. mid = int64(0)
  38. count = int64(0)
  39. )
  40. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  41. err := testDao.TrimUpRecent(c, mid, count)
  42. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  43. ctx.So(err, convey.ShouldBeNil)
  44. })
  45. })
  46. })
  47. }