package logic

import (
	"context"
	"github.com/zeromicro/go-zero/core/logx"
	"jyBXSubscribe/rpc/internal/svc"
	"jyBXSubscribe/rpc/type/bxsubscribe"
	"reflect"
	"testing"
)

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.Items
		wantErr bool
	}{
		// TODO: Add test cases.
		{
			name: "超级订阅获取",
			args: args{
				in: &bxsubscribe.GetKeyReq{
					UserType:    "mType",
					UserId:      "5e8eb60ae138234b4f91aacf",
					EntId:       "14640",
					AppId:       "10000",
					EntUserId:   "4962",
					NewUserId:   185483,
					UserPower:   0,
					MemberPower: 0,
					IsEnt:       false,
				},
			},
		},
	}
	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 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)
			}
		})
	}
}
