space_test.go 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. package space
  2. import (
  3. "context"
  4. "reflect"
  5. "testing"
  6. "time"
  7. "go-common/app/interface/main/app-interface/model/space"
  8. account "go-common/app/service/main/account/model"
  9. . "github.com/smartystreets/goconvey/convey"
  10. )
  11. func TestService_Space(t *testing.T) {
  12. type args struct {
  13. c context.Context
  14. mid int64
  15. vmid int64
  16. plat int8
  17. build int
  18. pn int
  19. ps int
  20. platform string
  21. device string
  22. mobiApp string
  23. name string
  24. now time.Time
  25. }
  26. tests := []struct {
  27. name string
  28. s *Service
  29. args args
  30. wantSp *space.Space
  31. wantErr error
  32. }{
  33. // TODO: Add test cases.
  34. }
  35. for _, tt := range tests {
  36. Convey(tt.name, t, func(t *testing.T) {
  37. gotSp, err := tt.s.Space(tt.args.c, tt.args.mid, tt.args.vmid, tt.args.plat, tt.args.build, tt.args.pn, tt.args.ps, tt.args.platform, tt.args.device, tt.args.mobiApp, tt.args.name, tt.args.now)
  38. So(err, ShouldEqual, tt.wantErr)
  39. So(gotSp, ShouldNotResemble, tt.wantSp)
  40. })
  41. }
  42. }
  43. func TestService_UpArcs(t *testing.T) {
  44. type args struct {
  45. c context.Context
  46. uid int64
  47. pn int
  48. ps int
  49. now time.Time
  50. }
  51. tests := []struct {
  52. name string
  53. s *Service
  54. args args
  55. wantRes *space.ArcList
  56. }{
  57. // TODO: Add test cases.
  58. }
  59. for _, tt := range tests {
  60. t.Run(tt.name, func(t *testing.T) {
  61. if gotRes := tt.s.UpArcs(tt.args.c, tt.args.uid, tt.args.pn, tt.args.ps, tt.args.now); !reflect.DeepEqual(gotRes, tt.wantRes) {
  62. t.Errorf("Service.UpArcs() = %v, want %v", gotRes, tt.wantRes)
  63. }
  64. })
  65. }
  66. }
  67. func TestService_UpArticles(t *testing.T) {
  68. type args struct {
  69. c context.Context
  70. uid int64
  71. pn int
  72. ps int
  73. }
  74. tests := []struct {
  75. name string
  76. s *Service
  77. args args
  78. wantRes *space.ArticleList
  79. }{
  80. // TODO: Add test cases.
  81. }
  82. for _, tt := range tests {
  83. t.Run(tt.name, func(t *testing.T) {
  84. if gotRes := tt.s.UpArticles(tt.args.c, tt.args.uid, tt.args.pn, tt.args.ps); !reflect.DeepEqual(gotRes, tt.wantRes) {
  85. t.Errorf("Service.UpArticles() = %v, want %v", gotRes, tt.wantRes)
  86. }
  87. })
  88. }
  89. }
  90. func TestService_favFolders(t *testing.T) {
  91. type args struct {
  92. c context.Context
  93. mid int64
  94. uid int64
  95. plat int8
  96. build int
  97. mobiApp string
  98. }
  99. tests := []struct {
  100. name string
  101. s *Service
  102. args args
  103. wantRes *space.FavList
  104. }{
  105. // TODO: Add test cases.
  106. }
  107. for _, tt := range tests {
  108. t.Run(tt.name, func(t *testing.T) {
  109. if gotRes := tt.s.favFolders(tt.args.c, tt.args.mid, tt.args.uid, nil, tt.args.plat, tt.args.build, tt.args.mobiApp); !reflect.DeepEqual(gotRes, tt.wantRes) {
  110. t.Errorf("Service.favFolders() = %v, want %v", gotRes, tt.wantRes)
  111. }
  112. })
  113. }
  114. }
  115. func TestService_Bangumi(t *testing.T) {
  116. type args struct {
  117. c context.Context
  118. mid int64
  119. uid int64
  120. pn int
  121. ps int
  122. }
  123. tests := []struct {
  124. name string
  125. s *Service
  126. args args
  127. wantRes *space.BangumiList
  128. }{
  129. // TODO: Add test cases.
  130. }
  131. for _, tt := range tests {
  132. t.Run(tt.name, func(t *testing.T) {
  133. if gotRes := tt.s.Bangumi(tt.args.c, tt.args.mid, tt.args.uid, nil, tt.args.pn, tt.args.ps); !reflect.DeepEqual(gotRes, tt.wantRes) {
  134. t.Errorf("Service.Bangumi() = %v, want %v", gotRes, tt.wantRes)
  135. }
  136. })
  137. }
  138. }
  139. func TestService_Community(t *testing.T) {
  140. type args struct {
  141. c context.Context
  142. uid int64
  143. pn int
  144. ps int
  145. ak string
  146. platform string
  147. }
  148. tests := []struct {
  149. name string
  150. s *Service
  151. args args
  152. wantRes *space.CommuList
  153. }{
  154. // TODO: Add test cases.
  155. }
  156. for _, tt := range tests {
  157. t.Run(tt.name, func(t *testing.T) {
  158. if gotRes := tt.s.Community(tt.args.c, tt.args.uid, tt.args.pn, tt.args.ps, tt.args.ak, tt.args.platform); !reflect.DeepEqual(gotRes, tt.wantRes) {
  159. t.Errorf("Service.Community() = %v, want %v", gotRes, tt.wantRes)
  160. }
  161. })
  162. }
  163. }
  164. func TestService_CoinArcs(t *testing.T) {
  165. type args struct {
  166. c context.Context
  167. uid int64
  168. pn int
  169. ps int
  170. }
  171. tests := []struct {
  172. name string
  173. s *Service
  174. args args
  175. wantRes *space.ArcList
  176. }{
  177. // TODO: Add test cases.
  178. }
  179. for _, tt := range tests {
  180. t.Run(tt.name, func(t *testing.T) {
  181. if gotRes := tt.s.CoinArcs(tt.args.c, 0, tt.args.uid, nil, tt.args.pn, tt.args.ps); !reflect.DeepEqual(gotRes, tt.wantRes) {
  182. t.Errorf("Service.CoinArcs() = %v, want %v", gotRes, tt.wantRes)
  183. }
  184. })
  185. }
  186. }
  187. func TestService_LikeArcs(t *testing.T) {
  188. type args struct {
  189. c context.Context
  190. uid int64
  191. pn int
  192. ps int
  193. }
  194. tests := []struct {
  195. name string
  196. s *Service
  197. args args
  198. wantRes *space.ArcList
  199. }{
  200. // TODO: Add test cases.
  201. }
  202. for _, tt := range tests {
  203. t.Run(tt.name, func(t *testing.T) {
  204. if gotRes := tt.s.LikeArcs(tt.args.c, 0, tt.args.uid, nil, tt.args.pn, tt.args.ps); !reflect.DeepEqual(gotRes, tt.wantRes) {
  205. t.Errorf("Service.LikeArcs() = %v, want %v", gotRes, tt.wantRes)
  206. }
  207. })
  208. }
  209. }
  210. func TestService_upClips(t *testing.T) {
  211. type args struct {
  212. c context.Context
  213. uid int64
  214. }
  215. tests := []struct {
  216. name string
  217. s *Service
  218. args args
  219. wantRes *space.ClipList
  220. }{
  221. // TODO: Add test cases.
  222. }
  223. for _, tt := range tests {
  224. t.Run(tt.name, func(t *testing.T) {
  225. if gotRes := tt.s.upClips(tt.args.c, tt.args.uid); !reflect.DeepEqual(gotRes, tt.wantRes) {
  226. t.Errorf("Service.upClips() = %v, want %v", gotRes, tt.wantRes)
  227. }
  228. })
  229. }
  230. }
  231. func TestService_upAlbums(t *testing.T) {
  232. type args struct {
  233. c context.Context
  234. uid int64
  235. }
  236. tests := []struct {
  237. name string
  238. s *Service
  239. args args
  240. wantRes *space.AlbumList
  241. }{
  242. // TODO: Add test cases.
  243. }
  244. for _, tt := range tests {
  245. t.Run(tt.name, func(t *testing.T) {
  246. if gotRes := tt.s.upAlbums(tt.args.c, tt.args.uid); !reflect.DeepEqual(gotRes, tt.wantRes) {
  247. t.Errorf("Service.upAlbums() = %v, want %v", gotRes, tt.wantRes)
  248. }
  249. })
  250. }
  251. }
  252. func TestService_card(t *testing.T) {
  253. type args struct {
  254. c context.Context
  255. vmid int64
  256. name string
  257. }
  258. tests := []struct {
  259. name string
  260. s *Service
  261. args args
  262. wantCard *account.Card
  263. wantErr bool
  264. }{
  265. // TODO: Add test cases.
  266. }
  267. for _, tt := range tests {
  268. t.Run(tt.name, func(t *testing.T) {
  269. gotCard, err := tt.s.card(tt.args.c, tt.args.vmid, tt.args.name)
  270. if (err != nil) != tt.wantErr {
  271. t.Errorf("Service.card() error = %v, wantErr %v", err, tt.wantErr)
  272. return
  273. }
  274. if !reflect.DeepEqual(gotCard, tt.wantCard) {
  275. t.Errorf("Service.card() = %v, want %v", gotCard, tt.wantCard)
  276. }
  277. })
  278. }
  279. }
  280. func TestService_audios(t *testing.T) {
  281. type args struct {
  282. c context.Context
  283. mid int64
  284. pn int
  285. ps int
  286. }
  287. tests := []struct {
  288. name string
  289. s *Service
  290. args args
  291. wantRes *space.AudioList
  292. }{
  293. // TODO: Add test cases.
  294. }
  295. for _, tt := range tests {
  296. t.Run(tt.name, func(t *testing.T) {
  297. if gotRes := tt.s.audios(tt.args.c, tt.args.mid, tt.args.pn, tt.args.ps); !reflect.DeepEqual(gotRes, tt.wantRes) {
  298. t.Errorf("Service.audios() = %v, want %v", gotRes, tt.wantRes)
  299. }
  300. })
  301. }
  302. }
  303. func TestService_Report(t *testing.T) {
  304. type args struct {
  305. c context.Context
  306. mid int64
  307. reason string
  308. ak string
  309. }
  310. tests := []struct {
  311. name string
  312. s *Service
  313. args args
  314. wantErr bool
  315. }{
  316. // TODO: Add test cases.
  317. }
  318. for _, tt := range tests {
  319. t.Run(tt.name, func(t *testing.T) {
  320. if err := tt.s.Report(tt.args.c, tt.args.mid, tt.args.reason, tt.args.ak); (err != nil) != tt.wantErr {
  321. t.Errorf("Service.Report() error = %v, wantErr %v", err, tt.wantErr)
  322. }
  323. })
  324. }
  325. }