test文件
This commit is contained in:
parent
81b1ff88bf
commit
a71dd0fbae
@ -160,9 +160,9 @@ func TestGameProviderRoutesReturnEmptyWhenVisibilityPolicyDenies(t *testing.T) {
|
||||
gameprovider.NewRegistry(provider),
|
||||
gameprovider.NewVisibilityPolicy(
|
||||
routeStubVisibilityGateway{
|
||||
region: integration.UserRegion{RegionID: "2046066409959649281", RegionCode: "TR"},
|
||||
level: integration.UserLevel{WealthLevel: 1},
|
||||
targetRegionCode: "TR",
|
||||
region: integration.UserRegion{RegionID: "2046066409959649281", RegionCode: "土耳其"},
|
||||
level: integration.UserLevel{WealthLevel: 2},
|
||||
targetRegionCode: "土耳其",
|
||||
},
|
||||
routeStubIPCountryResolver{countryCode: "TR"},
|
||||
),
|
||||
@ -201,11 +201,11 @@ func TestGameProviderRoutesReturnProvidersWhenVisibilityPolicyAllows(t *testing.
|
||||
gameprovider.NewRegistry(&routeStubProvider{}),
|
||||
gameprovider.NewVisibilityPolicy(
|
||||
routeStubVisibilityGateway{
|
||||
region: integration.UserRegion{RegionID: "2046066409959649281", RegionCode: "TR"},
|
||||
level: integration.UserLevel{WealthLevel: 2},
|
||||
targetRegionCode: "TR",
|
||||
region: integration.UserRegion{RegionID: "2046066409959649281", RegionCode: "土耳其"},
|
||||
level: integration.UserLevel{WealthLevel: 3},
|
||||
targetRegionCode: "土耳其",
|
||||
},
|
||||
routeStubIPCountryResolver{countryCode: "TR"},
|
||||
routeStubIPCountryResolver{countryCode: "ZA"},
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@ -33,6 +33,8 @@ func (s stubIPCountryResolver) CountryCode(context.Context, string) (string, err
|
||||
return s.countryCode, nil
|
||||
}
|
||||
|
||||
const account1007500UserID int64 = 2054163533368717314
|
||||
|
||||
func TestVisibilityPolicyAppliesTurkeyRegionOrIPWealthGate(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
@ -103,7 +105,7 @@ func TestVisibilityPolicyAppliesTurkeyRegionOrIPWealthGate(t *testing.T) {
|
||||
stubIPCountryResolver{countryCode: tt.ipCountry},
|
||||
)
|
||||
|
||||
result, err := policy.Evaluate(context.Background(), AuthUser{UserID: 1007500, SysOrigin: "LIKEI"}, "1.1.1.1")
|
||||
result, err := policy.Evaluate(context.Background(), AuthUser{UserID: account1007500UserID, SysOrigin: "LIKEI"}, "1.1.1.1")
|
||||
if err != nil {
|
||||
t.Fatalf("Evaluate() error = %v", err)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user