Enhance school creation functionality by introducing support for name sets in the API and UI. Update the catalog to include skills, traits, body attributes, needs, and name sets, improving character generation capabilities. Revise localization strings for better user guidance and update tests to validate the new name set functionality and ensure robustness in school creation processes.
This commit is contained in:
@@ -157,6 +157,8 @@ public class SchoolApiTests(AppHostFixture fixture)
|
||||
Assert.Equal("Кабинет директора", Assert.Single(ru.Rooms, room => room.DefName == "PrincipalsOffice").Label);
|
||||
Assert.Equal("Principal's office", Assert.Single(en.Rooms, room => room.DefName == "PrincipalsOffice").Label);
|
||||
Assert.Equal("yard", ru.DefaultMap.Territory?.Id);
|
||||
Assert.Equal("Славянский", Assert.Single(ru.NameSets, set => set.DefName == "Slavic").Label);
|
||||
Assert.Equal("Slavic", Assert.Single(en.NameSets, set => set.DefName == "Slavic").Label);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -206,6 +208,26 @@ public class SchoolApiTests(AppHostFixture fixture)
|
||||
Assert.Equal("unknown-mod", await ProblemCodeAsync(response));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task CreateSchool_WithAnUnknownNameSet_IsRejected()
|
||||
{
|
||||
using var client = fixture.App.CreateHttpClient("server");
|
||||
await ResetAsync(client);
|
||||
|
||||
using var response = await client.PostAsJsonAsync(
|
||||
"/api/schools",
|
||||
new
|
||||
{
|
||||
name = "Чужие имена",
|
||||
startDate = ExpectedDefaultStart,
|
||||
nameSetId = "NoSuchNames",
|
||||
},
|
||||
TestContext.Current.CancellationToken);
|
||||
|
||||
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
|
||||
Assert.Equal("unknown-name-set", await ProblemCodeAsync(response));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task CreateSchool_WithACustomConnectedMap_Succeeds()
|
||||
{
|
||||
@@ -335,6 +357,7 @@ public class SchoolApiTests(AppHostFixture fixture)
|
||||
IReadOnlyList<DefInfoResponse> Floors,
|
||||
IReadOnlyList<RoomInfoResponse> Rooms,
|
||||
IReadOnlyList<DefInfoResponse> Things,
|
||||
IReadOnlyList<DefInfoResponse> NameSets,
|
||||
MapLayoutResponse DefaultMap);
|
||||
|
||||
private sealed record DefInfoResponse(string DefName, string Label);
|
||||
|
||||
Reference in New Issue
Block a user