origin_test.go 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "time"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDaoBatchQueryAccount(t *testing.T) {
  9. convey.Convey("BatchQueryAccount", t, func(ctx convey.C) {
  10. var (
  11. c = context.Background()
  12. start = int64(0)
  13. limit = int64(0)
  14. )
  15. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  16. res, err := d.BatchQueryAccount(c, start, limit)
  17. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  18. ctx.So(err, convey.ShouldBeNil)
  19. ctx.So(res, convey.ShouldBeNil)
  20. })
  21. })
  22. })
  23. }
  24. func TestDaoQueryAccountByMid(t *testing.T) {
  25. convey.Convey("QueryAccountByMid", t, func(ctx convey.C) {
  26. var (
  27. c = context.Background()
  28. mid = int64(1)
  29. )
  30. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  31. res, err := d.QueryAccountByMid(c, mid)
  32. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  33. ctx.So(err, convey.ShouldBeNil)
  34. ctx.So(res, convey.ShouldBeNil)
  35. })
  36. })
  37. })
  38. }
  39. func TestDaoQueryAccountByTel(t *testing.T) {
  40. convey.Convey("QueryAccountByTel", t, func(ctx convey.C) {
  41. var (
  42. c = context.Background()
  43. tel = "13122111111"
  44. )
  45. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  46. res, err := d.QueryAccountByTel(c, tel)
  47. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  48. ctx.So(err, convey.ShouldBeNil)
  49. ctx.So(res, convey.ShouldBeNil)
  50. })
  51. })
  52. })
  53. }
  54. func TestDaoQueryAccountByMail(t *testing.T) {
  55. convey.Convey("QueryAccountByMail", t, func(ctx convey.C) {
  56. var (
  57. c = context.Background()
  58. mail = "598717394@qq.com"
  59. )
  60. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  61. res, err := d.QueryAccountByMail(c, mail)
  62. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  63. ctx.So(err, convey.ShouldBeNil)
  64. ctx.So(res, convey.ShouldBeNil)
  65. })
  66. })
  67. })
  68. }
  69. func TestDaoBatchQueryAccountByTime(t *testing.T) {
  70. convey.Convey("BatchQueryAccountByTime", t, func(ctx convey.C) {
  71. var (
  72. c = context.Background()
  73. start = time.Now()
  74. end = time.Now()
  75. )
  76. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  77. res, err := d.BatchQueryAccountByTime(c, start, end)
  78. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  79. ctx.So(err, convey.ShouldBeNil)
  80. ctx.So(res, convey.ShouldBeNil)
  81. })
  82. })
  83. })
  84. }
  85. func TestDaoBatchQueryAccountInfo(t *testing.T) {
  86. convey.Convey("BatchQueryAccountInfo", t, func(ctx convey.C) {
  87. var (
  88. c = context.Background()
  89. start = int64(0)
  90. limit = int64(0)
  91. suffix = int(0)
  92. )
  93. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  94. res, err := d.BatchQueryAccountInfo(c, start, limit, suffix)
  95. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  96. ctx.So(err, convey.ShouldBeNil)
  97. ctx.So(res, convey.ShouldBeNil)
  98. })
  99. })
  100. })
  101. }
  102. func TestDaoQueryAccountInfoByMid(t *testing.T) {
  103. convey.Convey("QueryAccountInfoByMid", t, func(ctx convey.C) {
  104. var (
  105. c = context.Background()
  106. mid = int64(2)
  107. )
  108. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  109. res, err := d.QueryAccountInfoByMid(c, mid)
  110. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  111. ctx.So(err, convey.ShouldBeNil)
  112. ctx.So(res, convey.ShouldBeNil)
  113. })
  114. })
  115. })
  116. }
  117. func TestDaoBatchQueryAccountInfoByTime(t *testing.T) {
  118. convey.Convey("BatchQueryAccountInfoByTime", t, func(ctx convey.C) {
  119. var (
  120. c = context.Background()
  121. start = time.Now()
  122. end = time.Now()
  123. suffix = int(0)
  124. )
  125. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  126. res, err := d.BatchQueryAccountInfoByTime(c, start, end, suffix)
  127. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  128. ctx.So(err, convey.ShouldBeNil)
  129. ctx.So(res, convey.ShouldBeNil)
  130. })
  131. })
  132. })
  133. }
  134. func TestDaoBatchQueryAccountSns(t *testing.T) {
  135. convey.Convey("BatchQueryAccountSns", t, func(ctx convey.C) {
  136. var (
  137. c = context.Background()
  138. start = int64(0)
  139. limit = int64(0)
  140. )
  141. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  142. res, err := d.BatchQueryAccountSns(c, start, limit)
  143. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  144. ctx.So(err, convey.ShouldBeNil)
  145. ctx.So(res, convey.ShouldBeNil)
  146. })
  147. })
  148. })
  149. }
  150. func TestDaoQueryAccountSnsByMid(t *testing.T) {
  151. convey.Convey("QueryAccountSnsByMid", t, func(ctx convey.C) {
  152. var (
  153. c = context.Background()
  154. mid = int64(2)
  155. )
  156. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  157. res, err := d.QueryAccountSnsByMid(c, mid)
  158. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  159. ctx.So(err, convey.ShouldBeNil)
  160. ctx.So(res, convey.ShouldNotBeNil)
  161. })
  162. })
  163. })
  164. }
  165. func TestDaoQueryTelBindLog(t *testing.T) {
  166. convey.Convey("QueryTelBindLog", t, func(ctx convey.C) {
  167. var (
  168. c = context.Background()
  169. mid = int64(2)
  170. )
  171. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  172. res, err := d.QueryTelBindLog(c, mid)
  173. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  174. ctx.So(err, convey.ShouldBeNil)
  175. ctx.So(res, convey.ShouldNotBeNil)
  176. })
  177. })
  178. })
  179. }
  180. func TestDaoQueryAccountRegByMid(t *testing.T) {
  181. convey.Convey("QueryAccountRegByMid", t, func(ctx convey.C) {
  182. var (
  183. c = context.Background()
  184. mid = int64(22222222)
  185. )
  186. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  187. res, err := d.QueryAccountRegByMid(c, mid)
  188. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  189. ctx.So(err, convey.ShouldBeNil)
  190. ctx.So(res, convey.ShouldBeNil)
  191. })
  192. })
  193. })
  194. }
  195. func TestDaoBatchQueryAccountRegByTime(t *testing.T) {
  196. convey.Convey("BatchQueryAccountRegByTime", t, func(ctx convey.C) {
  197. var (
  198. c = context.Background()
  199. start = time.Now()
  200. end = time.Now()
  201. suffix = int(0)
  202. )
  203. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  204. res, err := d.BatchQueryAccountRegByTime(c, start, end, suffix)
  205. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  206. ctx.So(err, convey.ShouldBeNil)
  207. ctx.So(res, convey.ShouldBeNil)
  208. })
  209. })
  210. })
  211. }