123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- package space
- import (
- "context"
- "reflect"
- "testing"
- "time"
- "go-common/app/interface/main/app-interface/model"
- "go-common/app/interface/main/app-interface/model/space"
- )
- func TestService_Contribute(t *testing.T) {
- type args struct {
- c context.Context
- plat int8
- build int
- vmid int64
- pn int
- ps int
- now time.Time
- }
- tests := []struct {
- name string
- s *Service
- args args
- wantRes *space.Contributes
- wantErr bool
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- gotRes, err := tt.s.Contribute(tt.args.c, tt.args.plat, tt.args.build, tt.args.vmid, tt.args.pn, tt.args.ps, tt.args.now)
- if (err != nil) != tt.wantErr {
- t.Errorf("Service.Contribute() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if !reflect.DeepEqual(gotRes, tt.wantRes) {
- t.Errorf("Service.Contribute() = %v, want %v", gotRes, tt.wantRes)
- }
- })
- }
- }
- func TestService_Contribution(t *testing.T) {
- type args struct {
- c context.Context
- plat int8
- build int
- vmid int64
- cursor *model.Cursor
- now time.Time
- }
- tests := []struct {
- name string
- s *Service
- args args
- wantRes *space.Contributes
- wantErr bool
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- gotRes, err := tt.s.Contribution(tt.args.c, tt.args.plat, tt.args.build, tt.args.vmid, tt.args.cursor, tt.args.now)
- if (err != nil) != tt.wantErr {
- t.Errorf("Service.Contribution() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if !reflect.DeepEqual(gotRes, tt.wantRes) {
- t.Errorf("Service.Contribution() = %v, want %v", gotRes, tt.wantRes)
- }
- })
- }
- }
- func TestService_firstContribute(t *testing.T) {
- type args struct {
- c context.Context
- vmid int64
- size int
- now time.Time
- }
- tests := []struct {
- name string
- s *Service
- args args
- wantRes *space.Contributes
- wantErr bool
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- gotRes, err := tt.s.firstContribute(tt.args.c, tt.args.vmid, tt.args.size, tt.args.now)
- if (err != nil) != tt.wantErr {
- t.Errorf("Service.firstContribute() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if !reflect.DeepEqual(gotRes, tt.wantRes) {
- t.Errorf("Service.firstContribute() = %v, want %v", gotRes, tt.wantRes)
- }
- })
- }
- }
- func TestService_dealContribute(t *testing.T) {
- type args struct {
- c context.Context
- plat int8
- build int
- vmid int64
- attrs *space.Attrs
- items []*space.Item
- now time.Time
- }
- tests := []struct {
- name string
- s *Service
- args args
- wantRes *space.Contributes
- wantErr bool
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- gotRes, err := tt.s.dealContribute(tt.args.c, tt.args.plat, tt.args.build, tt.args.vmid, tt.args.attrs, tt.args.items, tt.args.now)
- if (err != nil) != tt.wantErr {
- t.Errorf("Service.dealContribute() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if !reflect.DeepEqual(gotRes, tt.wantRes) {
- t.Errorf("Service.dealContribute() = %v, want %v", gotRes, tt.wantRes)
- }
- })
- }
- }
- func TestService_Clip(t *testing.T) {
- type args struct {
- c context.Context
- vmid int64
- pos int
- size int
- }
- tests := []struct {
- name string
- s *Service
- args args
- wantRes *space.ClipList
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- if gotRes := tt.s.Clip(tt.args.c, tt.args.vmid, tt.args.pos, tt.args.size); !reflect.DeepEqual(gotRes, tt.wantRes) {
- t.Errorf("Service.Clip() = %v, want %v", gotRes, tt.wantRes)
- }
- })
- }
- }
- func TestService_Album(t *testing.T) {
- type args struct {
- c context.Context
- vmid int64
- pos int
- size int
- }
- tests := []struct {
- name string
- s *Service
- args args
- wantRes *space.AlbumList
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- if gotRes := tt.s.Album(tt.args.c, tt.args.vmid, tt.args.pos, tt.args.size); !reflect.DeepEqual(gotRes, tt.wantRes) {
- t.Errorf("Service.Album() = %v, want %v", gotRes, tt.wantRes)
- }
- })
- }
- }
- func TestService_AddContribute(t *testing.T) {
- type args struct {
- c context.Context
- vmid int64
- attrs *space.Attrs
- items []*space.Item
- }
- tests := []struct {
- name string
- s *Service
- args args
- wantErr bool
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- if err := tt.s.AddContribute(tt.args.c, tt.args.vmid, tt.args.attrs, tt.args.items); (err != nil) != tt.wantErr {
- t.Errorf("Service.AddContribute() error = %v, wantErr %v", err, tt.wantErr)
- }
- })
- }
- }
|