123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677 |
- package logic
- import (
- "context"
- "github.com/zeromicro/go-zero/core/logx"
- "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/bxsubscribe"
- "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/internal/svc"
- "reflect"
- "testing"
- )
- func TestByPushHistoryLogic_ByPushHistory(t *testing.T) {
- type fields struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- Logger logx.Logger
- }
- type args struct {
- in *bxsubscribe.SubscribeInfosReq
- }
- tests := []struct {
- name string
- fields fields
- args args
- want *bxsubscribe.ByPushHistoryResp
- wantErr bool
- }{
- // TODO: Add test cases.
- {
- name: "111",
- args: args{in: &bxsubscribe.SubscribeInfosReq{
- UserId: "60054",
- AppId: "10000",
- UserType: "vType",
- },
- },
- },
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- l := &ByPushHistoryLogic{
- ctx: tt.fields.ctx,
- svcCtx: tt.fields.svcCtx,
- Logger: tt.fields.Logger,
- }
- got, err := l.ByPushHistory(tt.args.in)
- if (err != nil) != tt.wantErr {
- t.Errorf("ByPushHistory() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if !reflect.DeepEqual(got, tt.want) {
- t.Errorf("ByPushHistory() got = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestGetDistributorLogic_GetDistributor(t *testing.T) {
- type fields struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- Logger logx.Logger
- }
- type args struct {
- in *bxsubscribe.GetDistributorReq
- }
- tests := []struct {
- name string
- fields fields
- args args
- want *bxsubscribe.DistributorResp
- wantErr bool
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- l := &GetDistributorLogic{
- ctx: tt.fields.ctx,
- svcCtx: tt.fields.svcCtx,
- Logger: tt.fields.Logger,
- }
- got, err := l.GetDistributor(tt.args.in)
- if (err != nil) != tt.wantErr {
- t.Errorf("GetDistributor() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if !reflect.DeepEqual(got, tt.want) {
- t.Errorf("GetDistributor() got = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestGetKeyLogic_GetKey(t *testing.T) {
- type fields struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- Logger logx.Logger
- }
- type args struct {
- in *bxsubscribe.GetKeyReq
- }
- tests := []struct {
- name string
- fields fields
- args args
- want *bxsubscribe.KeyResp
- wantErr bool
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- l := &GetKeyLogic{
- ctx: tt.fields.ctx,
- svcCtx: tt.fields.svcCtx,
- Logger: tt.fields.Logger,
- }
- got, err := l.GetKey(tt.args.in)
- if (err != nil) != tt.wantErr {
- t.Errorf("GetKey() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if !reflect.DeepEqual(got, tt.want) {
- t.Errorf("GetKey() got = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestGetSubListLogic_GetSubList(t *testing.T) {
- type fields struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- Logger logx.Logger
- }
- type args struct {
- in *bxsubscribe.SubscribeInfosReq
- }
- tests := []struct {
- name string
- fields fields
- args args
- want *bxsubscribe.SubscribeInfosResp
- wantErr bool
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- l := &GetSubListLogic{
- ctx: tt.fields.ctx,
- svcCtx: tt.fields.svcCtx,
- Logger: tt.fields.Logger,
- }
- got, err := l.GetSubList(tt.args.in)
- if (err != nil) != tt.wantErr {
- t.Errorf("GetSubList() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if !reflect.DeepEqual(got, tt.want) {
- t.Errorf("GetSubList() got = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestGetSubScribeInfoLogic_GetSubScribeInfo(t *testing.T) {
- type fields struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- Logger logx.Logger
- }
- type args struct {
- in *bxsubscribe.UserReq
- }
- tests := []struct {
- name string
- fields fields
- args args
- want *bxsubscribe.UserResq
- wantErr bool
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- l := &GetSubScribeInfoLogic{
- ctx: tt.fields.ctx,
- svcCtx: tt.fields.svcCtx,
- Logger: tt.fields.Logger,
- }
- got, err := l.GetSubScribeInfo(tt.args.in)
- if (err != nil) != tt.wantErr {
- t.Errorf("GetSubScribeInfo() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if !reflect.DeepEqual(got, tt.want) {
- t.Errorf("GetSubScribeInfo() got = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestGetSubScribeInfoLogic_formatItems(t *testing.T) {
- type fields struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- Logger logx.Logger
- }
- type args struct {
- m []map[string]interface{}
- }
- tests := []struct {
- name string
- fields fields
- args args
- want []*bxsubscribe.Items
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- l := &GetSubScribeInfoLogic{
- ctx: tt.fields.ctx,
- svcCtx: tt.fields.svcCtx,
- Logger: tt.fields.Logger,
- }
- if got := l.formatItems(tt.args.m); !reflect.DeepEqual(got, tt.want) {
- t.Errorf("formatItems() = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestGetSubScribeInfoLogic_formatM(t *testing.T) {
- type fields struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- Logger logx.Logger
- }
- type args struct {
- m *map[string]interface{}
- }
- tests := []struct {
- name string
- fields fields
- args args
- want map[string]*bxsubscribe.List
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- l := &GetSubScribeInfoLogic{
- ctx: tt.fields.ctx,
- svcCtx: tt.fields.svcCtx,
- Logger: tt.fields.Logger,
- }
- if got := l.formatM(tt.args.m); !reflect.DeepEqual(got, tt.want) {
- t.Errorf("formatM() = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestGetSubSomeInfoLogic_GetSubSomeInfo(t *testing.T) {
- type fields struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- Logger logx.Logger
- }
- type args struct {
- in *bxsubscribe.SomeInfoReq
- }
- tests := []struct {
- name string
- fields fields
- args args
- want *bxsubscribe.SomeInfoResp
- wantErr bool
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- l := &GetSubSomeInfoLogic{
- ctx: tt.fields.ctx,
- svcCtx: tt.fields.svcCtx,
- Logger: tt.fields.Logger,
- }
- got, err := l.GetSubSomeInfo(tt.args.in)
- if (err != nil) != tt.wantErr {
- t.Errorf("GetSubSomeInfo() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if !reflect.DeepEqual(got, tt.want) {
- t.Errorf("GetSubSomeInfo() got = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestGetViewStatusLogic_GetViewStatus(t *testing.T) {
- type fields struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- Logger logx.Logger
- }
- type args struct {
- in *bxsubscribe.GetViewStatusReq
- }
- tests := []struct {
- name string
- fields fields
- args args
- want *bxsubscribe.ViewStatusResp
- wantErr bool
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- l := &GetViewStatusLogic{
- ctx: tt.fields.ctx,
- svcCtx: tt.fields.svcCtx,
- Logger: tt.fields.Logger,
- }
- got, err := l.GetViewStatus(tt.args.in)
- if (err != nil) != tt.wantErr {
- t.Errorf("GetViewStatus() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if !reflect.DeepEqual(got, tt.want) {
- t.Errorf("GetViewStatus() got = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestMsgDistributorLogic_MsgDistributor(t *testing.T) {
- type fields struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- Logger logx.Logger
- }
- type args struct {
- in *bxsubscribe.MsgDistributorReq
- }
- tests := []struct {
- name string
- fields fields
- args args
- want *bxsubscribe.StatusResp
- wantErr bool
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- l := &MsgDistributorLogic{
- ctx: tt.fields.ctx,
- svcCtx: tt.fields.svcCtx,
- Logger: tt.fields.Logger,
- }
- got, err := l.MsgDistributor(tt.args.in)
- if (err != nil) != tt.wantErr {
- t.Errorf("MsgDistributor() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if !reflect.DeepEqual(got, tt.want) {
- t.Errorf("MsgDistributor() got = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestNewByPushHistoryLogic(t *testing.T) {
- type args struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- tests := []struct {
- name string
- args args
- want *ByPushHistoryLogic
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- if got := NewByPushHistoryLogic(tt.args.ctx, tt.args.svcCtx); !reflect.DeepEqual(got, tt.want) {
- t.Errorf("NewByPushHistoryLogic() = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestNewGetDistributorLogic(t *testing.T) {
- type args struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- tests := []struct {
- name string
- args args
- want *GetDistributorLogic
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- if got := NewGetDistributorLogic(tt.args.ctx, tt.args.svcCtx); !reflect.DeepEqual(got, tt.want) {
- t.Errorf("NewGetDistributorLogic() = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestNewGetKeyLogic(t *testing.T) {
- type args struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- tests := []struct {
- name string
- args args
- want *GetKeyLogic
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- if got := NewGetKeyLogic(tt.args.ctx, tt.args.svcCtx); !reflect.DeepEqual(got, tt.want) {
- t.Errorf("NewGetKeyLogic() = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestNewGetSubListLogic(t *testing.T) {
- type args struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- tests := []struct {
- name string
- args args
- want *GetSubListLogic
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- if got := NewGetSubListLogic(tt.args.ctx, tt.args.svcCtx); !reflect.DeepEqual(got, tt.want) {
- t.Errorf("NewGetSubListLogic() = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestNewGetSubScribeInfoLogic(t *testing.T) {
- type args struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- tests := []struct {
- name string
- args args
- want *GetSubScribeInfoLogic
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- if got := NewGetSubScribeInfoLogic(tt.args.ctx, tt.args.svcCtx); !reflect.DeepEqual(got, tt.want) {
- t.Errorf("NewGetSubScribeInfoLogic() = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestNewGetSubSomeInfoLogic(t *testing.T) {
- type args struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- tests := []struct {
- name string
- args args
- want *GetSubSomeInfoLogic
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- if got := NewGetSubSomeInfoLogic(tt.args.ctx, tt.args.svcCtx); !reflect.DeepEqual(got, tt.want) {
- t.Errorf("NewGetSubSomeInfoLogic() = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestNewGetViewStatusLogic(t *testing.T) {
- type args struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- tests := []struct {
- name string
- args args
- want *GetViewStatusLogic
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- if got := NewGetViewStatusLogic(tt.args.ctx, tt.args.svcCtx); !reflect.DeepEqual(got, tt.want) {
- t.Errorf("NewGetViewStatusLogic() = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestNewMsgDistributorLogic(t *testing.T) {
- type args struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- tests := []struct {
- name string
- args args
- want *MsgDistributorLogic
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- if got := NewMsgDistributorLogic(tt.args.ctx, tt.args.svcCtx); !reflect.DeepEqual(got, tt.want) {
- t.Errorf("NewMsgDistributorLogic() = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestNewSetReadLogic(t *testing.T) {
- type args struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- tests := []struct {
- name string
- args args
- want *SetReadLogic
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- if got := NewSetReadLogic(tt.args.ctx, tt.args.svcCtx); !reflect.DeepEqual(got, tt.want) {
- t.Errorf("NewSetReadLogic() = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestNewUpdateSubScribeInfoLogic(t *testing.T) {
- type args struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- tests := []struct {
- name string
- args args
- want *UpdateSubScribeInfoLogic
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- if got := NewUpdateSubScribeInfoLogic(tt.args.ctx, tt.args.svcCtx); !reflect.DeepEqual(got, tt.want) {
- t.Errorf("NewUpdateSubScribeInfoLogic() = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestReverse(t *testing.T) {
- type args struct {
- arr *[]*bxsubscribe.UserStatus
- }
- tests := []struct {
- name string
- args args
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- })
- }
- }
- func TestSetReadLogic_SetRead(t *testing.T) {
- type fields struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- Logger logx.Logger
- }
- type args struct {
- in *bxsubscribe.SetReadReq
- }
- tests := []struct {
- name string
- fields fields
- args args
- want *bxsubscribe.StatusResp
- wantErr bool
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- l := &SetReadLogic{
- ctx: tt.fields.ctx,
- svcCtx: tt.fields.svcCtx,
- Logger: tt.fields.Logger,
- }
- got, err := l.SetRead(tt.args.in)
- if (err != nil) != tt.wantErr {
- t.Errorf("SetRead() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if !reflect.DeepEqual(got, tt.want) {
- t.Errorf("SetRead() got = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestUpdateSubScribeInfoLogic_UpdateSubScribeInfo(t *testing.T) {
- type fields struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- Logger logx.Logger
- }
- type args struct {
- in *bxsubscribe.UpdateSubScribeInfoReq
- }
- tests := []struct {
- name string
- fields fields
- args args
- want *bxsubscribe.StatusResp
- wantErr bool
- }{
- // TODO: Add test cases.
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- l := &UpdateSubScribeInfoLogic{
- ctx: tt.fields.ctx,
- svcCtx: tt.fields.svcCtx,
- Logger: tt.fields.Logger,
- }
- got, err := l.UpdateSubScribeInfo(tt.args.in)
- if (err != nil) != tt.wantErr {
- t.Errorf("UpdateSubScribeInfo() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if !reflect.DeepEqual(got, tt.want) {
- t.Errorf("UpdateSubScribeInfo() got = %v, want %v", got, tt.want)
- }
- })
- }
- }
|