This commit is contained in:
Leonid Pershin
2026-08-18 23:51:10 +03:00
parent d8f8db6a48
commit 65feda3756
50 changed files with 1485 additions and 224 deletions
@@ -23,6 +23,9 @@ public class PeopleDefTests
Assert.Equal("Славянский", catalog.Label("ru", catalog.NameSets["Slavic"]));
Assert.Equal("Slavic", catalog.Label("en", catalog.NameSets["Slavic"]));
Assert.Equal("Усидчивый", catalog.Label("ru", catalog.Traits["Diligent"]));
Assert.True(catalog.Subjects.ContainsKey("PrimarySchool"));
Assert.Equal("Начальные классы", catalog.Label("ru", catalog.Subjects["PrimarySchool"]));
Assert.Equal("Primary", catalog.Label("en", catalog.Subjects["PrimarySchool"]));
}
[Fact]
@@ -147,6 +150,30 @@ public class PeopleDefTests
Assert.Contains("Ghost", ex.Message);
}
[Fact]
public void Subject_UnknownSkill_FailsTheCatalog()
{
var ex = Assert.Throws<ContentLoadException>(() => _loader.Load(
[CatalogLoader.CorePackId],
[
PackDocuments.Def(CatalogLoader.CorePackId, "skills", "math", """{ "defName": "Mathematics" }"""),
PackDocuments.Def(
CatalogLoader.CorePackId,
"subjects",
"ghost",
"""
{
"defName": "GhostSubject",
"grades": { "min": 1, "max": 4 },
"hoursPerWeek": 2,
"skills": [{ "skill": "Missing", "share": 1 }]
}
"""),
]));
Assert.Contains("Missing", ex.Message);
}
[Fact]
public void OneWayIncompatibility_IsMutual()
{