cache_test.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. package dao
  2. import (
  3. "testing"
  4. "github.com/smartystreets/goconvey/convey"
  5. )
  6. func TestDaocountKey(t *testing.T) {
  7. var (
  8. mid = int64(123)
  9. )
  10. convey.Convey("countKey", t, func(ctx convey.C) {
  11. p1 := countKey(mid)
  12. ctx.Convey("p1 should not be nil", func(ctx convey.C) {
  13. ctx.So(p1, convey.ShouldNotBeEmpty)
  14. })
  15. })
  16. }
  17. func TestDaocacheSFUserCoin(t *testing.T) {
  18. var (
  19. mid = int64(123)
  20. )
  21. convey.Convey("cacheSFUserCoin", t, func(ctx convey.C) {
  22. p1 := d.cacheSFUserCoin(mid)
  23. ctx.Convey("p1 should not be nil", func(ctx convey.C) {
  24. ctx.So(p1, convey.ShouldNotBeEmpty)
  25. })
  26. })
  27. }
  28. func TestDaoitemCoinKey(t *testing.T) {
  29. var (
  30. aid = int64(1)
  31. tp = int64(60)
  32. )
  33. convey.Convey("itemCoinKey", t, func(ctx convey.C) {
  34. p1 := itemCoinKey(aid, tp)
  35. ctx.Convey("p1 should not be nil", func(ctx convey.C) {
  36. ctx.So(p1, convey.ShouldNotBeEmpty)
  37. })
  38. })
  39. }
  40. func TestDaocacheSFItemCoin(t *testing.T) {
  41. var (
  42. aid = int64(1)
  43. tp = int64(60)
  44. )
  45. convey.Convey("cacheSFItemCoin", t, func(ctx convey.C) {
  46. p1 := d.cacheSFItemCoin(aid, tp)
  47. ctx.Convey("p1 should not be nil", func(ctx convey.C) {
  48. ctx.So(p1, convey.ShouldNotBeEmpty)
  49. })
  50. })
  51. }
  52. func TestDaoexpKey(t *testing.T) {
  53. var (
  54. mid = int64(123)
  55. )
  56. convey.Convey("expKey", t, func(ctx convey.C) {
  57. key := expKey(mid)
  58. ctx.Convey("key should not be nil", func(ctx convey.C) {
  59. ctx.So(key, convey.ShouldNotBeEmpty)
  60. })
  61. })
  62. }