|
@@ -0,0 +1,677 @@
|
|
|
+package logic
|
|
|
+
|
|
|
+import (
|
|
|
+ "context"
|
|
|
+ "github.com/zeromicro/go-zero/core/logx"
|
|
|
+ "jyBXSubscribe/rpc/bxsubscribe"
|
|
|
+ "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)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|