123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- package favorite
- import (
- "context"
- "encoding/json"
- "fmt"
- "reflect"
- "testing"
- "go-common/app/interface/main/app-interface/model/favorite"
- "github.com/smartystreets/goconvey/convey"
- )
- var s *Service
- func TestFolder(t *testing.T) {
- var (
- c = context.TODO()
- )
- convey.Convey("Folder", t, func(ctx convey.C) {
- folder, err := s.Folder(c, "", "", "", "", "", 0, 1, 27515397, 27515397)
- b, _ := json.Marshal(folder)
- fmt.Printf("%s", b)
- ctx.Convey("Then err should be nil.", func(ctx convey.C) {
- ctx.So(err, convey.ShouldBeNil)
- })
- })
- }
- func TestService_FolderVideo(t *testing.T) {
- type args struct {
- c context.Context
- accessKey string
- actionKey string
- device string
- mobiApp string
- platform string
- keyword string
- order string
- build int
- tid int
- pn int
- ps int
- mid int64
- fid int64
- vmid int64
- }
- tests := []struct {
- name string
- s *Service
- args args
- wantFolder *favorite.FavideoList
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- 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) {
- t.Errorf("Service.FolderVideo() = %v, want %v", gotFolder, tt.wantFolder)
- }
- })
- }
- }
- func TestService_Topic(t *testing.T) {
- type args struct {
- c context.Context
- accessKey string
- actionKey string
- device string
- mobiApp string
- platform string
- build int
- ps int
- pn int
- mid int64
- }
- tests := []struct {
- name string
- s *Service
- args args
- wantTopic *favorite.TopicList
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- 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) {
- t.Errorf("Service.Topic() = %v, want %v", gotTopic, tt.wantTopic)
- }
- })
- }
- }
- func TestService_Article(t *testing.T) {
- type args struct {
- c context.Context
- mid int64
- pn int
- ps int
- }
- tests := []struct {
- name string
- s *Service
- args args
- wantArticle *favorite.ArticleList
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- if gotArticle := tt.s.Article(tt.args.c, tt.args.mid, tt.args.pn, tt.args.ps); !reflect.DeepEqual(gotArticle, tt.wantArticle) {
- t.Errorf("Service.Article() = %v, want %v", gotArticle, tt.wantArticle)
- }
- })
- }
- }
- func TestService_Clips(t *testing.T) {
- type args struct {
- c context.Context
- mid int64
- accessKey string
- actionKey string
- device string
- mobiApp string
- platform string
- build int
- pn int
- ps int
- }
- tests := []struct {
- name string
- s *Service
- args args
- wantClips *favorite.ClipsList
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- 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) {
- t.Errorf("Service.Clips() = %v, want %v", gotClips, tt.wantClips)
- }
- })
- }
- }
- func TestService_Albums(t *testing.T) {
- type args struct {
- c context.Context
- mid int64
- accessKey string
- actionKey string
- device string
- mobiApp string
- platform string
- build int
- pn int
- ps int
- }
- tests := []struct {
- name string
- s *Service
- args args
- wantAlbums *favorite.AlbumsList
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- 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) {
- t.Errorf("Service.Albums() = %v, want %v", gotAlbums, tt.wantAlbums)
- }
- })
- }
- }
- func TestService_Specil(t *testing.T) {
- type args struct {
- c context.Context
- accessKey string
- actionKey string
- device string
- mobiApp string
- platform string
- build int
- pn int
- ps int
- }
- tests := []struct {
- name string
- s *Service
- args args
- wantSpecil *favorite.SpList
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- 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) {
- t.Errorf("Service.Specil() = %v, want %v", gotSpecil, tt.wantSpecil)
- }
- })
- }
- }
- func TestService_Audio(t *testing.T) {
- type args struct {
- c context.Context
- accessKey string
- mid int64
- pn int
- ps int
- }
- tests := []struct {
- name string
- s *Service
- args args
- wantAudio *favorite.AudioList
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- 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) {
- t.Errorf("Service.Audio() = %v, want %v", gotAudio, tt.wantAudio)
- }
- })
- }
- }
- func TestTab(t *testing.T) {
- var (
- c = context.TODO()
- )
- convey.Convey("Tab", t, func(ctx convey.C) {
- tab, err := s.Tab(c, "", "", "", "", "", "", 0, 27515397)
- b, _ := json.Marshal(tab)
- fmt.Printf("%s", b)
- ctx.Convey("Then err should be nil.", func(ctx convey.C) {
- ctx.So(err, convey.ShouldBeNil)
- })
- })
- }
|