mc_test.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  1. package dao
  2. import (
  3. "context"
  4. "go-common/app/interface/main/dm2/model"
  5. "testing"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDaokeyMsgPubLock(t *testing.T) {
  9. convey.Convey("keyMsgPubLock", t, func(ctx convey.C) {
  10. var (
  11. mid = int64(0)
  12. color = int64(0)
  13. rnd = int64(0)
  14. mode = int32(0)
  15. fontsize = int32(0)
  16. ip = ""
  17. msg = ""
  18. )
  19. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  20. p1 := keyMsgPubLock(mid, color, rnd, mode, fontsize, ip, msg)
  21. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  22. ctx.So(p1, convey.ShouldNotBeNil)
  23. })
  24. })
  25. })
  26. }
  27. func TestDaokeyOidPubLock(t *testing.T) {
  28. convey.Convey("keyOidPubLock", t, func(ctx convey.C) {
  29. var (
  30. mid = int64(0)
  31. oid = int64(0)
  32. ip = ""
  33. )
  34. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  35. p1 := keyOidPubLock(mid, oid, ip)
  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 TestDaokeyPubCntLock(t *testing.T) {
  43. convey.Convey("keyPubCntLock", t, func(ctx convey.C) {
  44. var (
  45. mid = int64(0)
  46. color = int64(0)
  47. mode = int32(0)
  48. fontsize = int32(0)
  49. ip = ""
  50. msg = ""
  51. )
  52. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  53. p1 := keyPubCntLock(mid, color, mode, fontsize, ip, msg)
  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 TestDaokeyCharPubLock(t *testing.T) {
  61. convey.Convey("keyCharPubLock", t, func(ctx convey.C) {
  62. var (
  63. mid = int64(0)
  64. oid = int64(0)
  65. )
  66. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  67. p1 := keyCharPubLock(mid, oid)
  68. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  69. ctx.So(p1, convey.ShouldNotBeNil)
  70. })
  71. })
  72. })
  73. }
  74. func TestDaokeyXML(t *testing.T) {
  75. convey.Convey("keyXML", t, func(ctx convey.C) {
  76. var (
  77. oid = int64(0)
  78. )
  79. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  80. p1 := keyXML(oid)
  81. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  82. ctx.So(p1, convey.ShouldNotBeNil)
  83. })
  84. })
  85. })
  86. }
  87. func TestDaokeySubject(t *testing.T) {
  88. convey.Convey("keySubject", t, func(ctx convey.C) {
  89. var (
  90. tp = int32(0)
  91. oid = int64(0)
  92. )
  93. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  94. p1 := keySubject(tp, oid)
  95. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  96. ctx.So(p1, convey.ShouldNotBeNil)
  97. })
  98. })
  99. })
  100. }
  101. func TestDaokeyAjax(t *testing.T) {
  102. convey.Convey("keyAjax", t, func(ctx convey.C) {
  103. var (
  104. oid = int64(0)
  105. )
  106. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  107. p1 := keyAjax(oid)
  108. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  109. ctx.So(p1, convey.ShouldNotBeNil)
  110. })
  111. })
  112. })
  113. }
  114. func TestDaokeyJudge(t *testing.T) {
  115. convey.Convey("keyJudge", t, func(ctx convey.C) {
  116. var (
  117. tp = int8(0)
  118. oid = int64(0)
  119. dmid = int64(0)
  120. )
  121. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  122. p1 := keyJudge(tp, oid, dmid)
  123. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  124. ctx.So(p1, convey.ShouldNotBeNil)
  125. })
  126. })
  127. })
  128. }
  129. func TestDaokeyDMLimitMid(t *testing.T) {
  130. convey.Convey("keyDMLimitMid", t, func(ctx convey.C) {
  131. var (
  132. mid = int64(0)
  133. )
  134. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  135. p1 := keyDMLimitMid(mid)
  136. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  137. ctx.So(p1, convey.ShouldNotBeNil)
  138. })
  139. })
  140. })
  141. }
  142. func TestDaokeyAdvanceCmt(t *testing.T) {
  143. convey.Convey("keyAdvanceCmt", t, func(ctx convey.C) {
  144. var (
  145. mid = int64(0)
  146. oid = int64(0)
  147. mode = ""
  148. )
  149. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  150. p1 := keyAdvanceCmt(mid, oid, mode)
  151. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  152. ctx.So(p1, convey.ShouldNotBeNil)
  153. })
  154. })
  155. })
  156. }
  157. func TestDaokeyAdvLock(t *testing.T) {
  158. convey.Convey("keyAdvLock", t, func(ctx convey.C) {
  159. var (
  160. mid = int64(0)
  161. cid = int64(0)
  162. )
  163. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  164. p1 := keyAdvLock(mid, cid)
  165. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  166. ctx.So(p1, convey.ShouldNotBeNil)
  167. })
  168. })
  169. })
  170. }
  171. func TestDaokeyHistory(t *testing.T) {
  172. convey.Convey("keyHistory", t, func(ctx convey.C) {
  173. var (
  174. tp = int32(0)
  175. oid = int64(0)
  176. timestamp = int64(0)
  177. )
  178. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  179. p1 := keyHistory(tp, oid, timestamp)
  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 TestDaokeyHistoryIdx(t *testing.T) {
  187. convey.Convey("keyHistoryIdx", t, func(ctx convey.C) {
  188. var (
  189. tp = int32(0)
  190. oid = int64(0)
  191. month = ""
  192. )
  193. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  194. p1 := keyHistoryIdx(tp, oid, month)
  195. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  196. ctx.So(p1, convey.ShouldNotBeNil)
  197. })
  198. })
  199. })
  200. }
  201. func TestDaokeyDMMask(t *testing.T) {
  202. convey.Convey("keyDMMask", t, func(ctx convey.C) {
  203. var (
  204. tp = int32(0)
  205. oid = int64(0)
  206. plat = int8(0)
  207. )
  208. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  209. p1 := keyDMMask(tp, oid, plat)
  210. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  211. ctx.So(p1, convey.ShouldNotBeNil)
  212. })
  213. })
  214. })
  215. }
  216. func TestDaoSubjectCache(t *testing.T) {
  217. convey.Convey("SubjectCache", t, func(ctx convey.C) {
  218. var (
  219. c = context.Background()
  220. tp = int32(0)
  221. oid = int64(0)
  222. )
  223. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  224. testDao.SubjectCache(c, tp, oid)
  225. })
  226. })
  227. }
  228. func TestDaoSubjectsCache(t *testing.T) {
  229. convey.Convey("SubjectsCache", t, func(ctx convey.C) {
  230. var (
  231. c = context.Background()
  232. tp = int32(0)
  233. oids = []int64{}
  234. )
  235. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  236. cached, missed, err := testDao.SubjectsCache(c, tp, oids)
  237. ctx.Convey("Then err should be nil.cached,missed should not be nil.", func(ctx convey.C) {
  238. ctx.So(err, convey.ShouldBeNil)
  239. ctx.So(missed, convey.ShouldNotBeNil)
  240. ctx.So(cached, convey.ShouldNotBeNil)
  241. })
  242. })
  243. })
  244. }
  245. func TestDaoAddSubjectCache(t *testing.T) {
  246. convey.Convey("AddSubjectCache", t, func(ctx convey.C) {
  247. var (
  248. c = context.Background()
  249. sub = &model.Subject{}
  250. )
  251. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  252. err := testDao.AddSubjectCache(c, sub)
  253. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  254. ctx.So(err, convey.ShouldBeNil)
  255. })
  256. })
  257. })
  258. }
  259. func TestDaoDelXMLCache(t *testing.T) {
  260. convey.Convey("DelXMLCache", t, func(ctx convey.C) {
  261. var (
  262. c = context.Background()
  263. oid = int64(0)
  264. )
  265. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  266. err := testDao.DelXMLCache(c, oid)
  267. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  268. ctx.So(err, convey.ShouldBeNil)
  269. })
  270. })
  271. })
  272. }
  273. func TestDaoAddXMLCache(t *testing.T) {
  274. convey.Convey("AddXMLCache", t, func(ctx convey.C) {
  275. var (
  276. c = context.Background()
  277. oid = int64(0)
  278. value = []byte("")
  279. )
  280. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  281. err := testDao.AddXMLCache(c, oid, value)
  282. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  283. ctx.So(err, convey.ShouldBeNil)
  284. })
  285. })
  286. })
  287. }
  288. func TestDaoXMLCache(t *testing.T) {
  289. convey.Convey("XMLCache", t, func(ctx convey.C) {
  290. var (
  291. c = context.Background()
  292. oid = int64(0)
  293. )
  294. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  295. data, err := testDao.XMLCache(c, oid)
  296. ctx.Convey("Then err should be nil.data should not be nil.", func(ctx convey.C) {
  297. ctx.So(err, convey.ShouldBeNil)
  298. ctx.So(data, convey.ShouldNotBeNil)
  299. })
  300. })
  301. })
  302. }
  303. func TestDaoAjaxDMCache(t *testing.T) {
  304. convey.Convey("AjaxDMCache", t, func(ctx convey.C) {
  305. var (
  306. c = context.Background()
  307. oid = int64(0)
  308. )
  309. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  310. msgs, err := testDao.AjaxDMCache(c, oid)
  311. ctx.Convey("Then err should be nil.msgs should not be nil.", func(ctx convey.C) {
  312. ctx.So(err, convey.ShouldBeNil)
  313. ctx.So(msgs, convey.ShouldNotBeNil)
  314. })
  315. })
  316. })
  317. }
  318. func TestDaoAddAjaxDMCache(t *testing.T) {
  319. convey.Convey("AddAjaxDMCache", t, func(ctx convey.C) {
  320. var (
  321. c = context.Background()
  322. oid = int64(0)
  323. msgs = []string{}
  324. )
  325. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  326. err := testDao.AddAjaxDMCache(c, oid, msgs)
  327. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  328. ctx.So(err, convey.ShouldBeNil)
  329. })
  330. })
  331. })
  332. }
  333. func TestDaoSetDMJudgeCache(t *testing.T) {
  334. convey.Convey("SetDMJudgeCache", t, func(ctx convey.C) {
  335. var (
  336. c = context.Background()
  337. tp = int8(0)
  338. oid = int64(0)
  339. dmid = int64(0)
  340. l = &model.JudgeDMList{}
  341. )
  342. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  343. err := testDao.SetDMJudgeCache(c, tp, oid, dmid, l)
  344. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  345. ctx.So(err, convey.ShouldBeNil)
  346. })
  347. })
  348. })
  349. }
  350. func TestDaoDMJudgeCache(t *testing.T) {
  351. convey.Convey("DMJudgeCache", t, func(ctx convey.C) {
  352. var (
  353. c = context.Background()
  354. tp = int8(0)
  355. oid = int64(0)
  356. dmid = int64(0)
  357. )
  358. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  359. l, err := testDao.DMJudgeCache(c, tp, oid, dmid)
  360. ctx.Convey("Then err should be nil.l should not be nil.", func(ctx convey.C) {
  361. ctx.So(err, convey.ShouldBeNil)
  362. ctx.So(l, convey.ShouldNotBeNil)
  363. })
  364. })
  365. })
  366. }
  367. func TestDaoAddMsgPubLock(t *testing.T) {
  368. convey.Convey("AddMsgPubLock", t, func(ctx convey.C) {
  369. var (
  370. c = context.Background()
  371. mid = int64(0)
  372. color = int64(0)
  373. rnd = int64(0)
  374. mode = int32(0)
  375. fontsize = int32(0)
  376. ip = ""
  377. msg = ""
  378. )
  379. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  380. err := testDao.AddMsgPubLock(c, mid, color, rnd, mode, fontsize, ip, msg)
  381. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  382. ctx.So(err, convey.ShouldBeNil)
  383. })
  384. })
  385. })
  386. }
  387. func TestDaoMsgPublock(t *testing.T) {
  388. convey.Convey("MsgPublock", t, func(ctx convey.C) {
  389. var (
  390. c = context.Background()
  391. mid = int64(0)
  392. color = int64(0)
  393. rnd = int64(0)
  394. mode = int32(0)
  395. fontsize = int32(0)
  396. ip = ""
  397. msg = ""
  398. )
  399. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  400. cached, err := testDao.MsgPublock(c, mid, color, rnd, mode, fontsize, ip, msg)
  401. ctx.Convey("Then err should be nil.cached should not be nil.", func(ctx convey.C) {
  402. ctx.So(err, convey.ShouldBeNil)
  403. ctx.So(cached, convey.ShouldNotBeNil)
  404. })
  405. })
  406. })
  407. }
  408. func TestDaoAddOidPubLock(t *testing.T) {
  409. convey.Convey("AddOidPubLock", t, func(ctx convey.C) {
  410. var (
  411. c = context.Background()
  412. mid = int64(0)
  413. oid = int64(0)
  414. ip = ""
  415. )
  416. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  417. err := testDao.AddOidPubLock(c, mid, oid, ip)
  418. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  419. ctx.So(err, convey.ShouldBeNil)
  420. })
  421. })
  422. })
  423. }
  424. func TestDaoOidPubLock(t *testing.T) {
  425. convey.Convey("OidPubLock", t, func(ctx convey.C) {
  426. var (
  427. c = context.Background()
  428. mid = int64(0)
  429. oid = int64(0)
  430. ip = ""
  431. )
  432. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  433. cached, err := testDao.OidPubLock(c, mid, oid, ip)
  434. ctx.Convey("Then err should be nil.cached should not be nil.", func(ctx convey.C) {
  435. ctx.So(err, convey.ShouldBeNil)
  436. ctx.So(cached, convey.ShouldNotBeNil)
  437. })
  438. })
  439. })
  440. }
  441. func TestDaoAddDMLimitCache(t *testing.T) {
  442. convey.Convey("AddDMLimitCache", t, func(ctx convey.C) {
  443. var (
  444. c = context.Background()
  445. mid = int64(0)
  446. limiter = &model.Limiter{}
  447. )
  448. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  449. err := testDao.AddDMLimitCache(c, mid, limiter)
  450. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  451. ctx.So(err, convey.ShouldBeNil)
  452. })
  453. })
  454. })
  455. }
  456. func TestDaoDMLimitCache(t *testing.T) {
  457. convey.Convey("DMLimitCache", t, func(ctx convey.C) {
  458. var (
  459. c = context.Background()
  460. mid = int64(0)
  461. )
  462. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  463. limiter, err := testDao.DMLimitCache(c, mid)
  464. ctx.Convey("Then err should be nil.limiter should not be nil.", func(ctx convey.C) {
  465. ctx.So(err, convey.ShouldBeNil)
  466. ctx.So(limiter, convey.ShouldNotBeNil)
  467. })
  468. })
  469. })
  470. }
  471. func TestDaoAddAdvanceCmtCache(t *testing.T) {
  472. convey.Convey("AddAdvanceCmtCache", t, func(ctx convey.C) {
  473. var (
  474. c = context.Background()
  475. oid = int64(0)
  476. mid = int64(0)
  477. mode = ""
  478. adv = &model.AdvanceCmt{}
  479. )
  480. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  481. err := testDao.AddAdvanceCmtCache(c, oid, mid, mode, adv)
  482. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  483. ctx.So(err, convey.ShouldBeNil)
  484. })
  485. })
  486. })
  487. }
  488. func TestDaoAdvanceCmtCache(t *testing.T) {
  489. convey.Convey("AdvanceCmtCache", t, func(ctx convey.C) {
  490. var (
  491. c = context.Background()
  492. oid = int64(0)
  493. mid = int64(0)
  494. mode = ""
  495. )
  496. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  497. adv, err := testDao.AdvanceCmtCache(c, oid, mid, mode)
  498. ctx.Convey("Then err should be nil.adv should not be nil.", func(ctx convey.C) {
  499. ctx.So(err, convey.ShouldBeNil)
  500. ctx.So(adv, convey.ShouldNotBeNil)
  501. })
  502. })
  503. })
  504. }
  505. func TestDaoAddAdvanceLock(t *testing.T) {
  506. convey.Convey("AddAdvanceLock", t, func(ctx convey.C) {
  507. var (
  508. c = context.Background()
  509. mid = int64(0)
  510. cid = int64(0)
  511. )
  512. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  513. succeed := testDao.AddAdvanceLock(c, mid, cid)
  514. ctx.Convey("Then succeed should not be nil.", func(ctx convey.C) {
  515. ctx.So(succeed, convey.ShouldNotBeNil)
  516. })
  517. })
  518. })
  519. }
  520. func TestDaoDelAdvanceLock(t *testing.T) {
  521. convey.Convey("DelAdvanceLock", t, func(ctx convey.C) {
  522. var (
  523. c = context.Background()
  524. mid = int64(0)
  525. cid = int64(0)
  526. )
  527. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  528. err := testDao.DelAdvanceLock(c, mid, cid)
  529. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  530. ctx.So(err, convey.ShouldBeNil)
  531. })
  532. })
  533. })
  534. }
  535. func TestDaoDelAdvCache(t *testing.T) {
  536. convey.Convey("DelAdvCache", t, func(ctx convey.C) {
  537. var (
  538. c = context.Background()
  539. mid = int64(0)
  540. cid = int64(0)
  541. mode = ""
  542. )
  543. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  544. err := testDao.DelAdvCache(c, mid, cid, mode)
  545. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  546. ctx.So(err, convey.ShouldBeNil)
  547. })
  548. })
  549. })
  550. }
  551. func TestDaoAddHistoryCache(t *testing.T) {
  552. convey.Convey("AddHistoryCache", t, func(ctx convey.C) {
  553. var (
  554. c = context.Background()
  555. tp = int32(0)
  556. oid = int64(0)
  557. timestamp = int64(0)
  558. value = []byte("")
  559. )
  560. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  561. err := testDao.AddHistoryCache(c, tp, oid, timestamp, value)
  562. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  563. ctx.So(err, convey.ShouldBeNil)
  564. })
  565. })
  566. })
  567. }
  568. func TestDaoHistoryCache(t *testing.T) {
  569. convey.Convey("HistoryCache", t, func(ctx convey.C) {
  570. var (
  571. c = context.Background()
  572. tp = int32(0)
  573. oid = int64(0)
  574. timestamp = int64(0)
  575. )
  576. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  577. data, err := testDao.HistoryCache(c, tp, oid, timestamp)
  578. ctx.Convey("Then err should be nil.data should not be nil.", func(ctx convey.C) {
  579. ctx.So(err, convey.ShouldBeNil)
  580. ctx.So(data, convey.ShouldNotBeNil)
  581. })
  582. })
  583. })
  584. }
  585. func TestDaoAddHisIdxCache(t *testing.T) {
  586. convey.Convey("AddHisIdxCache", t, func(ctx convey.C) {
  587. var (
  588. c = context.Background()
  589. tp = int32(0)
  590. oid = int64(0)
  591. month = ""
  592. dates = []string{}
  593. )
  594. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  595. err := testDao.AddHisIdxCache(c, tp, oid, month, dates)
  596. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  597. ctx.So(err, convey.ShouldBeNil)
  598. })
  599. })
  600. })
  601. }
  602. func TestDaoHistoryIdxCache(t *testing.T) {
  603. convey.Convey("HistoryIdxCache", t, func(ctx convey.C) {
  604. var (
  605. c = context.Background()
  606. tp = int32(0)
  607. oid = int64(0)
  608. month = ""
  609. )
  610. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  611. dates, err := testDao.HistoryIdxCache(c, tp, oid, month)
  612. ctx.Convey("Then err should be nil.dates should not be nil.", func(ctx convey.C) {
  613. ctx.So(err, convey.ShouldBeNil)
  614. ctx.So(dates, convey.ShouldNotBeNil)
  615. })
  616. })
  617. })
  618. }
  619. func TestDaoDMMaskCache(t *testing.T) {
  620. convey.Convey("DMMaskCache", t, func(ctx convey.C) {
  621. var (
  622. c = context.Background()
  623. tp = int32(0)
  624. oid = int64(0)
  625. plat = int8(0)
  626. )
  627. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  628. testDao.DMMaskCache(c, tp, oid, plat)
  629. })
  630. })
  631. }
  632. func TestDaoAddMaskCache(t *testing.T) {
  633. convey.Convey("AddMaskCache", t, func(ctx convey.C) {
  634. var (
  635. c = context.Background()
  636. tp = int32(0)
  637. mask = &model.Mask{}
  638. )
  639. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  640. err := testDao.AddMaskCache(c, tp, mask)
  641. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  642. ctx.So(err, convey.ShouldBeNil)
  643. })
  644. })
  645. })
  646. }