favorite_test.go 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. package favorite
  2. import (
  3. "context"
  4. "encoding/json"
  5. "fmt"
  6. "reflect"
  7. "testing"
  8. "go-common/app/interface/main/app-interface/model/favorite"
  9. "github.com/smartystreets/goconvey/convey"
  10. )
  11. var s *Service
  12. func TestFolder(t *testing.T) {
  13. var (
  14. c = context.TODO()
  15. )
  16. convey.Convey("Folder", t, func(ctx convey.C) {
  17. folder, err := s.Folder(c, "", "", "", "", "", 0, 1, 27515397, 27515397)
  18. b, _ := json.Marshal(folder)
  19. fmt.Printf("%s", b)
  20. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  21. ctx.So(err, convey.ShouldBeNil)
  22. })
  23. })
  24. }
  25. func TestService_FolderVideo(t *testing.T) {
  26. type args struct {
  27. c context.Context
  28. accessKey string
  29. actionKey string
  30. device string
  31. mobiApp string
  32. platform string
  33. keyword string
  34. order string
  35. build int
  36. tid int
  37. pn int
  38. ps int
  39. mid int64
  40. fid int64
  41. vmid int64
  42. }
  43. tests := []struct {
  44. name string
  45. s *Service
  46. args args
  47. wantFolder *favorite.FavideoList
  48. }{
  49. // TODO: Add test cases.
  50. }
  51. for _, tt := range tests {
  52. t.Run(tt.name, func(t *testing.T) {
  53. if gotFolder := tt.s.FolderVideo(tt.args.c, tt.args.accessKey, tt.args.actionKey, tt.args.device, tt.args.mobiApp, tt.args.platform, tt.args.keyword, tt.args.order, tt.args.build, tt.args.tid, tt.args.pn, tt.args.ps, tt.args.mid, tt.args.fid, tt.args.vmid); !reflect.DeepEqual(gotFolder, tt.wantFolder) {
  54. t.Errorf("Service.FolderVideo() = %v, want %v", gotFolder, tt.wantFolder)
  55. }
  56. })
  57. }
  58. }
  59. func TestService_Topic(t *testing.T) {
  60. type args struct {
  61. c context.Context
  62. accessKey string
  63. actionKey string
  64. device string
  65. mobiApp string
  66. platform string
  67. build int
  68. ps int
  69. pn int
  70. mid int64
  71. }
  72. tests := []struct {
  73. name string
  74. s *Service
  75. args args
  76. wantTopic *favorite.TopicList
  77. }{
  78. // TODO: Add test cases.
  79. }
  80. for _, tt := range tests {
  81. t.Run(tt.name, func(t *testing.T) {
  82. if gotTopic := tt.s.Topic(tt.args.c, tt.args.accessKey, tt.args.actionKey, tt.args.device, tt.args.mobiApp, tt.args.platform, tt.args.build, tt.args.ps, tt.args.pn, tt.args.mid); !reflect.DeepEqual(gotTopic, tt.wantTopic) {
  83. t.Errorf("Service.Topic() = %v, want %v", gotTopic, tt.wantTopic)
  84. }
  85. })
  86. }
  87. }
  88. func TestService_Article(t *testing.T) {
  89. type args struct {
  90. c context.Context
  91. mid int64
  92. pn int
  93. ps int
  94. }
  95. tests := []struct {
  96. name string
  97. s *Service
  98. args args
  99. wantArticle *favorite.ArticleList
  100. }{
  101. // TODO: Add test cases.
  102. }
  103. for _, tt := range tests {
  104. t.Run(tt.name, func(t *testing.T) {
  105. if gotArticle := tt.s.Article(tt.args.c, tt.args.mid, tt.args.pn, tt.args.ps); !reflect.DeepEqual(gotArticle, tt.wantArticle) {
  106. t.Errorf("Service.Article() = %v, want %v", gotArticle, tt.wantArticle)
  107. }
  108. })
  109. }
  110. }
  111. func TestService_Clips(t *testing.T) {
  112. type args struct {
  113. c context.Context
  114. mid int64
  115. accessKey string
  116. actionKey string
  117. device string
  118. mobiApp string
  119. platform string
  120. build int
  121. pn int
  122. ps int
  123. }
  124. tests := []struct {
  125. name string
  126. s *Service
  127. args args
  128. wantClips *favorite.ClipsList
  129. }{
  130. // TODO: Add test cases.
  131. }
  132. for _, tt := range tests {
  133. t.Run(tt.name, func(t *testing.T) {
  134. if gotClips := tt.s.Clips(tt.args.c, tt.args.mid, tt.args.accessKey, tt.args.actionKey, tt.args.device, tt.args.mobiApp, tt.args.platform, tt.args.build, tt.args.pn, tt.args.ps); !reflect.DeepEqual(gotClips, tt.wantClips) {
  135. t.Errorf("Service.Clips() = %v, want %v", gotClips, tt.wantClips)
  136. }
  137. })
  138. }
  139. }
  140. func TestService_Albums(t *testing.T) {
  141. type args struct {
  142. c context.Context
  143. mid int64
  144. accessKey string
  145. actionKey string
  146. device string
  147. mobiApp string
  148. platform string
  149. build int
  150. pn int
  151. ps int
  152. }
  153. tests := []struct {
  154. name string
  155. s *Service
  156. args args
  157. wantAlbums *favorite.AlbumsList
  158. }{
  159. // TODO: Add test cases.
  160. }
  161. for _, tt := range tests {
  162. t.Run(tt.name, func(t *testing.T) {
  163. if gotAlbums := tt.s.Albums(tt.args.c, tt.args.mid, tt.args.accessKey, tt.args.actionKey, tt.args.device, tt.args.mobiApp, tt.args.platform, tt.args.build, tt.args.pn, tt.args.ps); !reflect.DeepEqual(gotAlbums, tt.wantAlbums) {
  164. t.Errorf("Service.Albums() = %v, want %v", gotAlbums, tt.wantAlbums)
  165. }
  166. })
  167. }
  168. }
  169. func TestService_Specil(t *testing.T) {
  170. type args struct {
  171. c context.Context
  172. accessKey string
  173. actionKey string
  174. device string
  175. mobiApp string
  176. platform string
  177. build int
  178. pn int
  179. ps int
  180. }
  181. tests := []struct {
  182. name string
  183. s *Service
  184. args args
  185. wantSpecil *favorite.SpList
  186. }{
  187. // TODO: Add test cases.
  188. }
  189. for _, tt := range tests {
  190. t.Run(tt.name, func(t *testing.T) {
  191. if gotSpecil := tt.s.Specil(tt.args.c, tt.args.accessKey, tt.args.actionKey, tt.args.device, tt.args.mobiApp, tt.args.platform, tt.args.build, tt.args.pn, tt.args.ps); !reflect.DeepEqual(gotSpecil, tt.wantSpecil) {
  192. t.Errorf("Service.Specil() = %v, want %v", gotSpecil, tt.wantSpecil)
  193. }
  194. })
  195. }
  196. }
  197. func TestService_Audio(t *testing.T) {
  198. type args struct {
  199. c context.Context
  200. accessKey string
  201. mid int64
  202. pn int
  203. ps int
  204. }
  205. tests := []struct {
  206. name string
  207. s *Service
  208. args args
  209. wantAudio *favorite.AudioList
  210. }{
  211. // TODO: Add test cases.
  212. }
  213. for _, tt := range tests {
  214. t.Run(tt.name, func(t *testing.T) {
  215. if gotAudio := tt.s.Audio(tt.args.c, tt.args.accessKey, tt.args.mid, tt.args.pn, tt.args.ps); !reflect.DeepEqual(gotAudio, tt.wantAudio) {
  216. t.Errorf("Service.Audio() = %v, want %v", gotAudio, tt.wantAudio)
  217. }
  218. })
  219. }
  220. }
  221. func TestTab(t *testing.T) {
  222. var (
  223. c = context.TODO()
  224. )
  225. convey.Convey("Tab", t, func(ctx convey.C) {
  226. tab, err := s.Tab(c, "", "", "", "", "", "", 0, 27515397)
  227. b, _ := json.Marshal(tab)
  228. fmt.Printf("%s", b)
  229. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  230. ctx.So(err, convey.ShouldBeNil)
  231. })
  232. })
  233. }