|
@@ -117,36 +117,6 @@ func TestEntClaimService_IsClaimed(t *testing.T) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// 取消认领
|
|
|
-func TestEntClaimService_Unclaimed(t *testing.T) {
|
|
|
- type args struct {
|
|
|
- id int
|
|
|
- userId int
|
|
|
- }
|
|
|
- tests := []struct {
|
|
|
- name string
|
|
|
- args args
|
|
|
- want bool
|
|
|
- }{
|
|
|
- {
|
|
|
- "取消认领", args{userId: 1, id: 2}, true,
|
|
|
- },
|
|
|
- {
|
|
|
- "取消认领-2", args{userId: 100, id: 2}, false,
|
|
|
- },
|
|
|
- {
|
|
|
- "取消认领-3", args{userId: 100, id: 900009}, false,
|
|
|
- },
|
|
|
- }
|
|
|
- for _, tt := range tests {
|
|
|
- t.Run(tt.name, func(t *testing.T) {
|
|
|
- if got := EntClaimSrv.Unclaimed(tt.args.id, tt.args.userId); got != tt.want {
|
|
|
- t.Errorf("Unclaimed() = %v, want %v", got, tt.want)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
// 获取企业基本信息
|
|
|
func TestEntClaimService_GetInstitution(t *testing.T) {
|
|
|
type args struct {
|
|
@@ -171,8 +141,9 @@ func TestEntClaimService_GetInstitution(t *testing.T) {
|
|
|
}
|
|
|
func TestName(t *testing.T) {
|
|
|
s := encrypt.SE.DecodeString("QgpHCARNUAdXBRVXSF9URFMIAwIRVxIPVExUVlMEQV0=")
|
|
|
- //s1 := encrypt.SE.Encode2Hex(common.ObjToString("001d050b"))
|
|
|
- fmt.Print(s, 2)
|
|
|
+ s1 := encrypt.SE.EncodeString("90058")
|
|
|
+ fmt.Println(s)
|
|
|
+ fmt.Println(s1)
|
|
|
}
|
|
|
|
|
|
func TestEntClaimService_GetInstitutionByIds(t *testing.T) {
|
|
@@ -185,7 +156,7 @@ func TestEntClaimService_GetInstitutionByIds(t *testing.T) {
|
|
|
args args
|
|
|
}{
|
|
|
{
|
|
|
- "获取企业基本信息", args{ids: []string{"6e7fa9b7f0a88110a827e8ba18ffb1522"}},
|
|
|
+ "获取企业基本信息", args{ids: []string{"6e7fa9b7f0a88110a827e8ba18ffb152"}},
|
|
|
},
|
|
|
}
|
|
|
for _, tt := range tests {
|
|
@@ -195,3 +166,30 @@ func TestEntClaimService_GetInstitutionByIds(t *testing.T) {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+func TestEntClaimService_UnclaimedByEnt(t *testing.T) {
|
|
|
+
|
|
|
+ type args struct {
|
|
|
+ userId int
|
|
|
+ entId string
|
|
|
+ type_ int
|
|
|
+ }
|
|
|
+ tests := []struct {
|
|
|
+ name string
|
|
|
+ args args
|
|
|
+ want bool
|
|
|
+ want1 int
|
|
|
+ }{}
|
|
|
+ for _, tt := range tests {
|
|
|
+ t.Run(tt.name, func(t *testing.T) {
|
|
|
+
|
|
|
+ got, got1 := EntClaimSrv.UnclaimedByEnt(tt.args.userId, tt.args.entId, tt.args.type_)
|
|
|
+ if got != tt.want {
|
|
|
+ t.Errorf("UnclaimedByEnt() got = %v, want %v", got, tt.want)
|
|
|
+ }
|
|
|
+ if got1 != tt.want1 {
|
|
|
+ t.Errorf("UnclaimedByEnt() got1 = %v, want %v", got1, tt.want1)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|