Enhance school creation and map management features by updating the API to support mod packs and map layouts. Introduce a new map snapshot protocol for efficient data handling during school sessions. Revise documentation to reflect these changes, including updates to the protocol and architecture documents. Improve UI components for mod selection and map editing, ensuring a better user experience. Update tests to validate new functionalities and ensure robustness.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
namespace HSchool.Content.Tests;
|
||||
|
||||
public class MapViewTests
|
||||
{
|
||||
[Fact]
|
||||
public void VanillaMap_LabelsTheTreeInTheRequestedLocale()
|
||||
{
|
||||
var root = Path.Combine(AppContext.BaseDirectory, "vanilla");
|
||||
var documents = PackDocuments.FromDirectory(CatalogLoader.CorePackId, root);
|
||||
var catalog = new CatalogLoader().Load([CatalogLoader.CorePackId], documents);
|
||||
var map = CatalogLoader.LastDefaultMap([CatalogLoader.CorePackId], documents);
|
||||
Assert.NotNull(map);
|
||||
|
||||
var ru = MapView.Build(catalog, map, "ru");
|
||||
var en = MapView.Build(catalog, map, "en");
|
||||
|
||||
Assert.Equal(["yard", "main", "floor-1", "corridor-1", "principals-office"], ru.Select(node => node.Id));
|
||||
Assert.Equal(string.Empty, ru[0].ParentId);
|
||||
Assert.Equal("yard", ru.Single(node => node.Id == "main").ParentId);
|
||||
Assert.Equal("floor-1", ru.Single(node => node.Id == "principals-office").ParentId);
|
||||
|
||||
var officeRu = ru.Single(node => node.Id == "principals-office");
|
||||
Assert.Equal("Кабинет директора", officeRu.Name);
|
||||
Assert.Equal(["Кресло директора", "Стол", "Стул"], officeRu.Items);
|
||||
Assert.Equal(["Директор"], officeRu.Positions);
|
||||
|
||||
var officeEn = en.Single(node => node.Id == "principals-office");
|
||||
Assert.Equal("Principal's office", officeEn.Name);
|
||||
Assert.Equal(["Principal's chair", "Desk", "Chair"], officeEn.Items);
|
||||
Assert.Equal(["Principal"], officeEn.Positions);
|
||||
|
||||
var corridor = ru.Single(node => node.Id == "corridor-1");
|
||||
Assert.Empty(corridor.Items);
|
||||
Assert.Empty(corridor.Positions);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user