Add review tests for notices, scene prompts, and Play lock.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using HSchool.Content;
|
||||
using HSchool.Server.Api;
|
||||
using HSchool.Server.Game;
|
||||
using HSchool.Simulation;
|
||||
|
||||
@@ -101,6 +102,56 @@ public class PortraitSceneCollectorTests
|
||||
Assert.DoesNotContain(scene.PositiveFragments, fragment => fragment.Contains("<embed:", StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CollectThenBuild_PutsBlackboardAfterClothing_ChairRoomDoesNot()
|
||||
{
|
||||
var catalog = LoadCatalog();
|
||||
var map = SampleMap();
|
||||
var profile = SwarmUiPresetDefinition.CreateDefault().ToProfile(PortraitKind.Avatar);
|
||||
var card = SampleWornCard();
|
||||
|
||||
var withBoard = PortraitSceneCollector.Collect(
|
||||
catalog, map, "class-1", Precipitation.None, "TestClimate", [], [], Budget);
|
||||
var (positive, _) = PortraitPromptBuilder.Build(card, profile, PortraitKind.Avatar, scene: withBoard);
|
||||
var clothesAt = positive.IndexOf("wearing a white shirt", StringComparison.OrdinalIgnoreCase);
|
||||
var sceneAt = positive.IndexOf("blackboard", StringComparison.OrdinalIgnoreCase);
|
||||
Assert.True(clothesAt >= 0 && sceneAt > clothesAt);
|
||||
|
||||
var chairs = PortraitSceneCollector.Collect(
|
||||
catalog, map, "chairs", Precipitation.None, "TestClimate", [], [], Budget);
|
||||
var (without, _) = PortraitPromptBuilder.Build(card, profile, PortraitKind.Avatar, scene: chairs);
|
||||
Assert.DoesNotContain("blackboard", without, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.DoesNotContain("chair", without, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
private static PersonCardResponse SampleWornCard() =>
|
||||
new(
|
||||
"f0.c0",
|
||||
"Maria Ivanova",
|
||||
"Ivanova",
|
||||
"Maria",
|
||||
"",
|
||||
true,
|
||||
12,
|
||||
new DateTime(2000, 3, 14, 0, 0, 0, DateTimeKind.Utc),
|
||||
["student"],
|
||||
5,
|
||||
"A",
|
||||
"class-1",
|
||||
null,
|
||||
null,
|
||||
[new LabeledStatResponse("HairColor", "Hair colour", "Black")],
|
||||
[],
|
||||
[],
|
||||
[],
|
||||
null,
|
||||
null,
|
||||
new PersonFamilyResponse([], [], [], []),
|
||||
[new WornItemResponse("Shirt", "Shirt", "White", "White", [new DefLabelResponse(ApparelLayers.Top, "Top")], 1f, "new", [ApparelLayers.Underwear])],
|
||||
[],
|
||||
0f,
|
||||
0f);
|
||||
|
||||
private DefCatalog LoadCatalog()
|
||||
{
|
||||
return _loader.Load(
|
||||
|
||||
Reference in New Issue
Block a user