feat(platform): improve admin data workflows
This commit is contained in:
@@ -41,3 +41,29 @@ func TestIdentityOfEmbeddedEntity(t *testing.T) {
|
||||
t.Fatalf("identityOf(nil) = %q, want empty", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIdentityOfDirectIdentityField(t *testing.T) {
|
||||
record := struct {
|
||||
Identity string
|
||||
}{Identity: "mock-direct-identity"}
|
||||
if got := identityOf(&record); got != record.Identity {
|
||||
t.Fatalf("identityOf() = %q, want %q", got, record.Identity)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAdditionalScenarioIdentitiesDoNotOverlapBaseScenario(t *testing.T) {
|
||||
seen := make(map[string]struct{}, 226)
|
||||
for sequence := 1; sequence <= 56; sequence++ {
|
||||
seen[entity(sequence, common.StatusEnable).Identity] = struct{}{}
|
||||
}
|
||||
for scenario := 2; scenario <= 10; scenario++ {
|
||||
base := 1000 + scenario*100
|
||||
for offset := 1; offset <= 20; offset++ {
|
||||
identity := entity(base+offset, common.StatusEnable).Identity
|
||||
if _, exists := seen[identity]; exists {
|
||||
t.Fatalf("duplicate identity %q", identity)
|
||||
}
|
||||
seen[identity] = struct{}{}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user