member_test.go 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoexpKey(t *testing.T) {
  8. var (
  9. mid = int64(0)
  10. )
  11. convey.Convey("expKey", t, func(ctx convey.C) {
  12. p1 := expKey(mid)
  13. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  14. ctx.So(p1, convey.ShouldNotBeNil)
  15. })
  16. })
  17. }
  18. func TestDaokeyInfo(t *testing.T) {
  19. var (
  20. mid = int64(0)
  21. )
  22. convey.Convey("keyInfo", t, func(ctx convey.C) {
  23. p1 := keyInfo(mid)
  24. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  25. ctx.So(p1, convey.ShouldNotBeNil)
  26. })
  27. })
  28. }
  29. func TestDaomcBaseKey(t *testing.T) {
  30. var (
  31. mid = int64(0)
  32. )
  33. convey.Convey("mcBaseKey", t, func(ctx convey.C) {
  34. key := d.mcBaseKey(mid)
  35. ctx.Convey("Then key should not be nil.", func(ctx convey.C) {
  36. ctx.So(key, convey.ShouldNotBeNil)
  37. })
  38. })
  39. }
  40. func TestDaomoralKey(t *testing.T) {
  41. var (
  42. mid = int64(0)
  43. )
  44. convey.Convey("moralKey", t, func(ctx convey.C) {
  45. key := d.moralKey(mid)
  46. ctx.Convey("Then key should not be nil.", func(ctx convey.C) {
  47. ctx.So(key, convey.ShouldNotBeNil)
  48. })
  49. })
  50. }
  51. func TestDaoDelMoralCache(t *testing.T) {
  52. var (
  53. c = context.Background()
  54. mid = int64(0)
  55. )
  56. convey.Convey("DelMoralCache", t, func(ctx convey.C) {
  57. err := d.DelMoralCache(c, mid)
  58. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  59. ctx.So(err, convey.ShouldBeNil)
  60. })
  61. })
  62. }
  63. func TestDaoDelBaseInfoCache(t *testing.T) {
  64. var (
  65. c = context.Background()
  66. mid = int64(0)
  67. )
  68. convey.Convey("DelBaseInfoCache", t, func(ctx convey.C) {
  69. err := d.DelBaseInfoCache(c, mid)
  70. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  71. ctx.So(err, convey.ShouldBeNil)
  72. })
  73. })
  74. }
  75. func TestDaoDelInfoCache(t *testing.T) {
  76. var (
  77. c = context.Background()
  78. mid = int64(0)
  79. )
  80. convey.Convey("DelInfoCache", t, func(ctx convey.C) {
  81. err := d.DelInfoCache(c, mid)
  82. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  83. ctx.So(err, convey.ShouldBeNil)
  84. })
  85. })
  86. }
  87. func TestDaorealnameApplyStatusKey(t *testing.T) {
  88. var (
  89. mid = int64(0)
  90. )
  91. convey.Convey("realnameApplyStatusKey", t, func(ctx convey.C) {
  92. p1 := realnameApplyStatusKey(mid)
  93. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  94. ctx.So(p1, convey.ShouldNotBeNil)
  95. })
  96. })
  97. }
  98. func TestDaoDeleteRealnameCache(t *testing.T) {
  99. var (
  100. c = context.Background()
  101. mid = int64(0)
  102. )
  103. convey.Convey("DeleteRealnameCache", t, func(ctx convey.C) {
  104. err := d.DeleteRealnameCache(c, mid)
  105. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  106. ctx.So(err, convey.ShouldBeNil)
  107. })
  108. })
  109. }
  110. func TestDaoSetExpCache(t *testing.T) {
  111. var (
  112. c = context.Background()
  113. mid = int64(0)
  114. exp = int64(0)
  115. )
  116. convey.Convey("SetExpCache", t, func(ctx convey.C) {
  117. err := d.SetExpCache(c, mid, exp)
  118. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  119. ctx.So(err, convey.ShouldBeNil)
  120. })
  121. })
  122. }
  123. func TestDaoDelExpCache(t *testing.T) {
  124. var (
  125. c = context.Background()
  126. mid = int64(0)
  127. )
  128. convey.Convey("DelExpCache", t, func(ctx convey.C) {
  129. err := d.DelExpCache(c, mid)
  130. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  131. ctx.So(err, convey.ShouldBeNil)
  132. })
  133. })
  134. }