icon_redis_test.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package dao
  2. import (
  3. "context"
  4. resmdl "go-common/app/service/main/resource/model"
  5. "testing"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDaoSetIndexIconCache(t *testing.T) {
  9. convey.Convey("SetIndexIconCache", t, func(ctx convey.C) {
  10. var (
  11. c = context.Background()
  12. data = []*resmdl.IndexIcon{}
  13. )
  14. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  15. err := d.SetIndexIconCache(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 TestDaoIndexIconCache(t *testing.T) {
  23. convey.Convey("IndexIconCache", t, func(ctx convey.C) {
  24. var (
  25. c = context.Background()
  26. )
  27. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  28. res, err := d.IndexIconCache(c)
  29. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  30. ctx.So(err, convey.ShouldBeNil)
  31. ctx.Printf("%+v", res)
  32. })
  33. })
  34. })
  35. }
  36. func TestDaoIndexIconBakCache(t *testing.T) {
  37. convey.Convey("IndexIconBakCache", t, func(ctx convey.C) {
  38. var (
  39. c = context.Background()
  40. )
  41. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  42. res, err := d.IndexIconBakCache(c)
  43. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  44. ctx.So(err, convey.ShouldBeNil)
  45. ctx.Printf("%+v", res)
  46. })
  47. })
  48. })
  49. }