mc.cache.key_test.go 901 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package dao
  2. import (
  3. "context"
  4. "go-common/app/service/main/tv/internal/model"
  5. "testing"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDaouserInfoKey(t *testing.T) {
  9. convey.Convey("userInfoKey", t, func(ctx convey.C) {
  10. var (
  11. mid = int64(27515308)
  12. )
  13. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  14. p1 := userInfoKey(mid)
  15. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  16. ctx.So(p1, convey.ShouldNotBeNil)
  17. })
  18. })
  19. })
  20. }
  21. func TestDaopayParamKey(t *testing.T) {
  22. convey.Convey("payParamKey", t, func(ctx convey.C) {
  23. var (
  24. token = "TOKEN:34567345678"
  25. )
  26. d.AddCachePayParam(context.TODO(), token, &model.PayParam{})
  27. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  28. p1 := payParamKey(token)
  29. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  30. ctx.So(p1, convey.ShouldNotBeNil)
  31. })
  32. })
  33. })
  34. }