databus_test.go 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. package dao
  2. import (
  3. "context"
  4. "go-common/app/service/main/favorite/model"
  5. "testing"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestFavsend(t *testing.T) {
  9. var (
  10. c = context.TODO()
  11. mid = int64(0)
  12. msg = &model.Message{}
  13. )
  14. convey.Convey("send", t, func(ctx convey.C) {
  15. err := d.send(c, mid, msg)
  16. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  17. ctx.So(err, convey.ShouldBeNil)
  18. })
  19. })
  20. }
  21. func TestFavPubAddFav(t *testing.T) {
  22. var (
  23. c = context.TODO()
  24. tp = int8(0)
  25. mid = int64(0)
  26. fid = int64(0)
  27. oid = int64(0)
  28. attr = int32(0)
  29. ts = int64(0)
  30. )
  31. convey.Convey("PubAddFav", t, func(ctx convey.C) {
  32. d.PubAddFav(c, tp, mid, fid, oid, attr, ts, tp)
  33. ctx.Convey("No return values", func(ctx convey.C) {
  34. })
  35. })
  36. }
  37. func TestFavPubDelFav(t *testing.T) {
  38. var (
  39. c = context.TODO()
  40. tp = int8(0)
  41. mid = int64(0)
  42. fid = int64(0)
  43. oid = int64(0)
  44. attr = int32(0)
  45. ts = int64(0)
  46. )
  47. convey.Convey("PubDelFav", t, func(ctx convey.C) {
  48. d.PubDelFav(c, tp, mid, fid, oid, attr, ts, tp)
  49. ctx.Convey("No return values", func(ctx convey.C) {
  50. })
  51. })
  52. }
  53. func TestFavPubInitRelationFids(t *testing.T) {
  54. var (
  55. c = context.TODO()
  56. tp = int8(0)
  57. mid = int64(0)
  58. )
  59. convey.Convey("PubInitRelationFids", t, func(ctx convey.C) {
  60. d.PubInitRelationFids(c, tp, mid)
  61. ctx.Convey("No return values", func(ctx convey.C) {
  62. })
  63. })
  64. }
  65. func TestFavPubInitFolderRelations(t *testing.T) {
  66. var (
  67. c = context.TODO()
  68. tp = int8(0)
  69. mid = int64(0)
  70. fid = int64(0)
  71. )
  72. convey.Convey("PubInitFolderRelations", t, func(ctx convey.C) {
  73. d.PubInitFolderRelations(c, tp, mid, fid)
  74. ctx.Convey("No return values", func(ctx convey.C) {
  75. })
  76. })
  77. }
  78. func TestFavPubAddFolder(t *testing.T) {
  79. var (
  80. c = context.TODO()
  81. typ = int8(0)
  82. mid = int64(0)
  83. fid = int64(0)
  84. attr = int32(0)
  85. )
  86. convey.Convey("PubAddFolder", t, func(ctx convey.C) {
  87. d.PubAddFolder(c, typ, mid, fid, attr)
  88. ctx.Convey("No return values", func(ctx convey.C) {
  89. })
  90. })
  91. }
  92. func TestFavPubDelFolder(t *testing.T) {
  93. var (
  94. c = context.TODO()
  95. typ = int8(0)
  96. mid = int64(0)
  97. fid = int64(0)
  98. attr = int32(0)
  99. ts = int64(0)
  100. )
  101. convey.Convey("PubDelFolder", t, func(ctx convey.C) {
  102. d.PubDelFolder(c, typ, mid, fid, attr, ts)
  103. ctx.Convey("No return values", func(ctx convey.C) {
  104. })
  105. })
  106. }
  107. func TestFavPubMultiDelFavs(t *testing.T) {
  108. var (
  109. c = context.TODO()
  110. typ = int8(0)
  111. mid = int64(0)
  112. fid = int64(0)
  113. rows = int64(0)
  114. attr = int32(0)
  115. oids = []int64{}
  116. ts = int64(0)
  117. )
  118. convey.Convey("PubMultiDelFavs", t, func(ctx convey.C) {
  119. d.PubMultiDelFavs(c, typ, mid, fid, rows, attr, oids, ts)
  120. ctx.Convey("No return values", func(ctx convey.C) {
  121. })
  122. })
  123. }
  124. func TestFavPubMultiAddFavs(t *testing.T) {
  125. var (
  126. c = context.TODO()
  127. typ = int8(0)
  128. mid = int64(0)
  129. fid = int64(0)
  130. rows = int64(0)
  131. attr = int32(0)
  132. oids = []int64{}
  133. ts = int64(0)
  134. )
  135. convey.Convey("PubMultiAddFavs", t, func(ctx convey.C) {
  136. d.PubMultiAddFavs(c, typ, mid, fid, rows, attr, oids, ts)
  137. ctx.Convey("No return values", func(ctx convey.C) {
  138. })
  139. })
  140. }
  141. func TestFavPubMoveFavs(t *testing.T) {
  142. var (
  143. c = context.TODO()
  144. typ = int8(0)
  145. mid = int64(0)
  146. ofid = int64(0)
  147. nfid = int64(0)
  148. rows = int64(0)
  149. oids = []int64{}
  150. ts = int64(0)
  151. )
  152. convey.Convey("PubMoveFavs", t, func(ctx convey.C) {
  153. d.PubMoveFavs(c, typ, mid, ofid, nfid, rows, oids, ts)
  154. ctx.Convey("No return values", func(ctx convey.C) {
  155. })
  156. })
  157. }
  158. func TestFavPubCopyFavs(t *testing.T) {
  159. var (
  160. c = context.TODO()
  161. typ = int8(0)
  162. mid = int64(0)
  163. ofid = int64(0)
  164. nfid = int64(0)
  165. rows = int64(0)
  166. oids = []int64{}
  167. ts = int64(0)
  168. )
  169. convey.Convey("PubCopyFavs", t, func(ctx convey.C) {
  170. d.PubCopyFavs(c, typ, mid, ofid, nfid, rows, oids, ts)
  171. ctx.Convey("No return values", func(ctx convey.C) {
  172. })
  173. })
  174. }