mc.cache_test.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package anchorReward
  2. import (
  3. "context"
  4. model "go-common/app/service/live/xrewardcenter/model/anchorTask"
  5. "testing"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestAnchorRewardCacheRewardConf(t *testing.T) {
  9. convey.Convey("CacheRewardConf", t, func(ctx convey.C) {
  10. var (
  11. c = context.Background()
  12. id = int64(0)
  13. )
  14. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  15. res, err := d.CacheRewardConf(c, id)
  16. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  17. ctx.So(err, convey.ShouldBeNil)
  18. ctx.So(res, convey.ShouldNotBeNil)
  19. })
  20. })
  21. })
  22. }
  23. func TestAnchorRewardAddCacheRewardConf(t *testing.T) {
  24. convey.Convey("AddCacheRewardConf", t, func(ctx convey.C) {
  25. var (
  26. c = context.Background()
  27. id = int64(0)
  28. val = &model.AnchorRewardConf{}
  29. )
  30. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  31. err := d.AddCacheRewardConf(c, id, val)
  32. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  33. ctx.So(err, convey.ShouldBeNil)
  34. })
  35. })
  36. })
  37. }