mc_test.go 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/job/main/passport-user/model"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDaoubKey(t *testing.T) {
  9. convey.Convey("ubKey", t, func(ctx convey.C) {
  10. var (
  11. mid = int64(0)
  12. )
  13. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  14. p1 := ubKey(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 TestDaoutKey(t *testing.T) {
  22. convey.Convey("utKey", t, func(ctx convey.C) {
  23. var (
  24. mid = int64(0)
  25. )
  26. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  27. p1 := utKey(mid)
  28. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  29. ctx.So(p1, convey.ShouldNotBeNil)
  30. })
  31. })
  32. })
  33. }
  34. func TestDaoueKey(t *testing.T) {
  35. convey.Convey("ueKey", t, func(ctx convey.C) {
  36. var (
  37. mid = int64(0)
  38. )
  39. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  40. p1 := ueKey(mid)
  41. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  42. ctx.So(p1, convey.ShouldNotBeNil)
  43. })
  44. })
  45. })
  46. }
  47. func TestDaouroKey(t *testing.T) {
  48. convey.Convey("uroKey", t, func(ctx convey.C) {
  49. var (
  50. mid = int64(0)
  51. )
  52. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  53. p1 := uroKey(mid)
  54. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  55. ctx.So(p1, convey.ShouldNotBeNil)
  56. })
  57. })
  58. })
  59. }
  60. func TestDaousqKey(t *testing.T) {
  61. convey.Convey("usqKey", t, func(ctx convey.C) {
  62. var (
  63. mid = int64(0)
  64. )
  65. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  66. p1 := usqKey(mid)
  67. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  68. ctx.So(p1, convey.ShouldNotBeNil)
  69. })
  70. })
  71. })
  72. }
  73. func TestDaoqqKey(t *testing.T) {
  74. convey.Convey("qqKey", t, func(ctx convey.C) {
  75. var (
  76. mid = int64(0)
  77. )
  78. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  79. p1 := qqKey(mid)
  80. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  81. ctx.So(p1, convey.ShouldNotBeNil)
  82. })
  83. })
  84. })
  85. }
  86. func TestDaosinaKey(t *testing.T) {
  87. convey.Convey("sinaKey", t, func(ctx convey.C) {
  88. var (
  89. mid = int64(0)
  90. )
  91. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  92. p1 := sinaKey(mid)
  93. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  94. ctx.So(p1, convey.ShouldNotBeNil)
  95. })
  96. })
  97. })
  98. }
  99. func TestDaoSetUserBaseCache(t *testing.T) {
  100. convey.Convey("SetUserBaseCache", t, func(ctx convey.C) {
  101. var (
  102. c = context.Background()
  103. ub = &model.UserBase{}
  104. )
  105. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  106. err := d.SetUserBaseCache(c, ub)
  107. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  108. ctx.So(err, convey.ShouldBeNil)
  109. })
  110. })
  111. })
  112. }
  113. func TestDaoSetUserTelCache(t *testing.T) {
  114. convey.Convey("SetUserTelCache", t, func(ctx convey.C) {
  115. var (
  116. c = context.Background()
  117. ut = &model.UserTel{}
  118. )
  119. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  120. err := d.SetUserTelCache(c, ut)
  121. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  122. ctx.So(err, convey.ShouldBeNil)
  123. })
  124. })
  125. })
  126. }
  127. func TestDaoSetUserEmailCache(t *testing.T) {
  128. convey.Convey("SetUserEmailCache", t, func(ctx convey.C) {
  129. var (
  130. c = context.Background()
  131. ue = &model.UserEmail{}
  132. )
  133. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  134. err := d.SetUserEmailCache(c, ue)
  135. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  136. ctx.So(err, convey.ShouldBeNil)
  137. })
  138. })
  139. })
  140. }
  141. func TestDaoSetUserRegOriginCache(t *testing.T) {
  142. convey.Convey("SetUserRegOriginCache", t, func(ctx convey.C) {
  143. var (
  144. c = context.Background()
  145. uro = &model.UserRegOrigin{}
  146. )
  147. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  148. err := d.SetUserRegOriginCache(c, uro)
  149. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  150. ctx.So(err, convey.ShouldBeNil)
  151. })
  152. })
  153. })
  154. }
  155. func TestDaoSetUserSafeQuestionCache(t *testing.T) {
  156. convey.Convey("SetUserSafeQuestionCache", t, func(ctx convey.C) {
  157. var (
  158. c = context.Background()
  159. usq = &model.UserSafeQuestion{}
  160. )
  161. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  162. err := d.SetUserSafeQuestionCache(c, usq)
  163. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  164. ctx.So(err, convey.ShouldBeNil)
  165. })
  166. })
  167. })
  168. }
  169. func TestDaoSetUserThirdBindQQCache(t *testing.T) {
  170. convey.Convey("SetUserThirdBindQQCache", t, func(ctx convey.C) {
  171. var (
  172. c = context.Background()
  173. utb = &model.UserThirdBind{}
  174. )
  175. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  176. err := d.SetUserThirdBindQQCache(c, utb)
  177. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  178. ctx.So(err, convey.ShouldBeNil)
  179. })
  180. })
  181. })
  182. }
  183. func TestDaoSetUserThirdBindSinaCache(t *testing.T) {
  184. convey.Convey("SetUserThirdBindSinaCache", t, func(ctx convey.C) {
  185. var (
  186. c = context.Background()
  187. utb = &model.UserThirdBind{}
  188. )
  189. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  190. err := d.SetUserThirdBindSinaCache(c, utb)
  191. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  192. ctx.So(err, convey.ShouldBeNil)
  193. })
  194. })
  195. })
  196. }
  197. func TestDaoDelUserBaseCache(t *testing.T) {
  198. convey.Convey("DelUserBaseCache", t, func(ctx convey.C) {
  199. var (
  200. c = context.Background()
  201. mid = int64(0)
  202. )
  203. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  204. err := d.DelUserBaseCache(c, mid)
  205. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  206. ctx.So(err, convey.ShouldBeNil)
  207. })
  208. })
  209. })
  210. }
  211. func TestDaoDelUserTelCache(t *testing.T) {
  212. convey.Convey("DelUserTelCache", t, func(ctx convey.C) {
  213. var (
  214. c = context.Background()
  215. mid = int64(0)
  216. )
  217. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  218. err := d.DelUserTelCache(c, mid)
  219. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  220. ctx.So(err, convey.ShouldBeNil)
  221. })
  222. })
  223. })
  224. }
  225. func TestDaoDelUserEmailCache(t *testing.T) {
  226. convey.Convey("DelUserEmailCache", t, func(ctx convey.C) {
  227. var (
  228. c = context.Background()
  229. mid = int64(0)
  230. )
  231. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  232. err := d.DelUserEmailCache(c, mid)
  233. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  234. ctx.So(err, convey.ShouldBeNil)
  235. })
  236. })
  237. })
  238. }
  239. func TestDaopingMC(t *testing.T) {
  240. convey.Convey("pingMC", t, func(ctx convey.C) {
  241. var (
  242. c = context.Background()
  243. )
  244. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  245. err := d.pingMC(c)
  246. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  247. ctx.So(err, convey.ShouldBeNil)
  248. })
  249. })
  250. })
  251. }