online_redis_test.go 1014 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/interface/main/web/model"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDaoSetOnlineListBakCache(t *testing.T) {
  9. convey.Convey("SetOnlineListBakCache", t, func(ctx convey.C) {
  10. var (
  11. c = context.Background()
  12. data = []*model.OnlineArc{{OnlineCount: 111}, {OnlineCount: 222}}
  13. )
  14. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  15. err := d.SetOnlineListBakCache(c, data)
  16. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  17. ctx.So(err, convey.ShouldBeNil)
  18. })
  19. })
  20. })
  21. }
  22. func TestDaoOnlineListBakCache(t *testing.T) {
  23. convey.Convey("OnlineListBakCache", t, func(ctx convey.C) {
  24. var (
  25. c = context.Background()
  26. )
  27. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  28. rs, err := d.OnlineListBakCache(c)
  29. ctx.Convey("Then err should be nil.rs should not be nil.", func(ctx convey.C) {
  30. ctx.So(err, convey.ShouldBeNil)
  31. ctx.So(rs, convey.ShouldNotBeNil)
  32. })
  33. })
  34. })
  35. }