123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- package logic
- import (
- "context"
- "github.com/zeromicro/go-zero/core/logx"
- "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXSubscribe/rpc/internal/svc"
- "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/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)
- }
- })
- }
- }
|