cache_test.go 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. package like
  2. import (
  3. "testing"
  4. "github.com/smartystreets/goconvey/convey"
  5. )
  6. func TestLikelikeKey(t *testing.T) {
  7. convey.Convey("likeKey", t, func(ctx convey.C) {
  8. var (
  9. id = int64(7)
  10. )
  11. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  12. p1 := likeKey(id)
  13. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  14. ctx.So(p1, convey.ShouldNotBeNil)
  15. })
  16. })
  17. })
  18. }
  19. func TestLikeactSubjectKey(t *testing.T) {
  20. convey.Convey("actSubjectKey", t, func(ctx convey.C) {
  21. var (
  22. id = int64(7)
  23. )
  24. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  25. p1 := actSubjectKey(id)
  26. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  27. ctx.So(p1, convey.ShouldNotBeNil)
  28. })
  29. })
  30. })
  31. }
  32. func TestLikeactSubjectMaxIDKey(t *testing.T) {
  33. convey.Convey("actSubjectMaxIDKey", t, func(ctx convey.C) {
  34. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  35. p1 := actSubjectMaxIDKey()
  36. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  37. ctx.So(p1, convey.ShouldNotBeNil)
  38. })
  39. })
  40. })
  41. }
  42. func TestLikelikeMaxIDKey(t *testing.T) {
  43. convey.Convey("likeMaxIDKey", t, func(ctx convey.C) {
  44. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  45. p1 := likeMaxIDKey()
  46. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  47. ctx.So(p1, convey.ShouldNotBeNil)
  48. })
  49. })
  50. })
  51. }
  52. func TestLikelikeMissionBuffKey(t *testing.T) {
  53. convey.Convey("likeMissionBuffKey", t, func(ctx convey.C) {
  54. var (
  55. sid = int64(10256)
  56. mid = int64(1)
  57. )
  58. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  59. p1 := likeMissionBuffKey(sid, mid)
  60. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  61. ctx.So(p1, convey.ShouldNotBeNil)
  62. })
  63. })
  64. })
  65. }
  66. func TestLikelikeMissionGroupIDkey(t *testing.T) {
  67. convey.Convey("likeMissionGroupIDkey", t, func(ctx convey.C) {
  68. var (
  69. lid = int64(1)
  70. )
  71. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  72. p1 := likeMissionGroupIDkey(lid)
  73. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  74. ctx.So(p1, convey.ShouldNotBeNil)
  75. })
  76. })
  77. })
  78. }
  79. func TestLikelikeActMissionKey(t *testing.T) {
  80. convey.Convey("likeActMissionKey", t, func(ctx convey.C) {
  81. var (
  82. sid = int64(10256)
  83. lid = int64(1)
  84. mid = int64(77)
  85. )
  86. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  87. p1 := likeActMissionKey(sid, lid, mid)
  88. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  89. ctx.So(p1, convey.ShouldNotBeNil)
  90. })
  91. })
  92. })
  93. }
  94. func TestLikeactAchieveKey(t *testing.T) {
  95. convey.Convey("actAchieveKey", t, func(ctx convey.C) {
  96. var (
  97. sid = int64(10256)
  98. )
  99. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  100. p1 := actAchieveKey(sid)
  101. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  102. ctx.So(p1, convey.ShouldNotBeNil)
  103. })
  104. })
  105. })
  106. }
  107. func TestLikeactMissionFriendsKey(t *testing.T) {
  108. convey.Convey("actMissionFriendsKey", t, func(ctx convey.C) {
  109. var (
  110. sid = int64(10256)
  111. lid = int64(77)
  112. )
  113. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  114. p1 := actMissionFriendsKey(sid, lid)
  115. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  116. ctx.So(p1, convey.ShouldNotBeNil)
  117. })
  118. })
  119. })
  120. }
  121. func TestLikeactUserAchieveKey(t *testing.T) {
  122. convey.Convey("actUserAchieveKey", t, func(ctx convey.C) {
  123. var (
  124. id = int64(1)
  125. )
  126. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  127. p1 := actUserAchieveKey(id)
  128. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  129. ctx.So(p1, convey.ShouldNotBeNil)
  130. })
  131. })
  132. })
  133. }
  134. func TestLikeactUserAchieveAwardKey(t *testing.T) {
  135. convey.Convey("actUserAchieveAwardKey", t, func(ctx convey.C) {
  136. var (
  137. id = int64(1)
  138. )
  139. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  140. p1 := actUserAchieveAwardKey(id)
  141. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  142. ctx.So(p1, convey.ShouldNotBeNil)
  143. })
  144. })
  145. })
  146. }
  147. func TestLikesubjectStatKey(t *testing.T) {
  148. convey.Convey("subjectStatKey", t, func(ctx convey.C) {
  149. var (
  150. sid = int64(10256)
  151. )
  152. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  153. p1 := subjectStatKey(sid)
  154. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  155. ctx.So(p1, convey.ShouldNotBeNil)
  156. })
  157. })
  158. })
  159. }
  160. func TestLikeviewRankKey(t *testing.T) {
  161. convey.Convey("viewRankKey", t, func(ctx convey.C) {
  162. var (
  163. sid = int64(10256)
  164. )
  165. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  166. p1 := viewRankKey(sid)
  167. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  168. ctx.So(p1, convey.ShouldNotBeNil)
  169. })
  170. })
  171. })
  172. }
  173. func TestLikelikeContentKey(t *testing.T) {
  174. convey.Convey("likeContentKey", t, func(ctx convey.C) {
  175. var (
  176. lid = int64(1)
  177. )
  178. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  179. p1 := likeContentKey(lid)
  180. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  181. ctx.So(p1, convey.ShouldNotBeNil)
  182. })
  183. })
  184. })
  185. }
  186. func TestSubjectProtocolKey(t *testing.T) {
  187. convey.Convey("subjectProtocolKey", t, func(ctx convey.C) {
  188. var (
  189. sid = int64(1)
  190. )
  191. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  192. p1 := subjectProtocolKey(sid)
  193. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  194. ctx.So(p1, convey.ShouldNotBeNil)
  195. })
  196. })
  197. })
  198. }