diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-29 05:42:36 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-29 05:42:36 +0800 |
| commit | 4971a2ada6db9a37807bf46a29dbea3d9edbf06a (patch) | |
| tree | 2fa44306526fe26d0d6c9b88c63bf357844508f5 /src/LivingVillage.Desktop.Tests | |
| parent | 1354745258f08fae0eea2c599b59fbbfb3254dbd (diff) | |
| download | living-village-4971a2ada6db9a37807bf46a29dbea3d9edbf06a.tar.gz | |
p64: A3 样板三处视觉雕琢(俯瞰上半补种/桥栏杆与护岸石/内景家具)+ 证据
Diffstat (limited to 'src/LivingVillage.Desktop.Tests')
3 files changed, 62 insertions, 3 deletions
diff --git a/src/LivingVillage.Desktop.Tests/LivingVillage.Desktop.Tests.fsproj b/src/LivingVillage.Desktop.Tests/LivingVillage.Desktop.Tests.fsproj index a6a05e6..9f60cce 100644 --- a/src/LivingVillage.Desktop.Tests/LivingVillage.Desktop.Tests.fsproj +++ b/src/LivingVillage.Desktop.Tests/LivingVillage.Desktop.Tests.fsproj @@ -36,6 +36,7 @@ <Compile Include="P57MenuHighlightTests.fs" /> <Compile Include="P61GlyphCoverageTests.fs" /> <Compile Include="P62EvidenceTests.fs" /> + <Compile Include="P64EvidenceTests.fs" /> <Compile Include="SampleTests.fs" /> </ItemGroup> diff --git a/src/LivingVillage.Desktop.Tests/P64EvidenceTests.fs b/src/LivingVillage.Desktop.Tests/P64EvidenceTests.fs new file mode 100644 index 0000000..9000a04 --- /dev/null +++ b/src/LivingVillage.Desktop.Tests/P64EvidenceTests.fs @@ -0,0 +1,56 @@ +namespace LivingVillage.Desktop.Tests + +open Microsoft.VisualStudio.TestTools.UnitTesting +open LivingVillage.Kernel +open LivingVillage.Kernel.Sim +open LivingVillage.Desktop +open LivingVillage.Desktop.VillagePresentation + +/// P64(A3 成熟度):样板区三处视觉缺口的可复现约束。 +/// 1. 俯瞰上半部(local y 0..6)不再是空场:足量中密度补种且种类多样。 +/// 2. 桥在既有位置加可读性细节:4 块护岸石分列桥两侧水线。 +/// 3. 内景下半部补入椅/凳/床尾凳/壶 4 件家具。 +[<TestClass>] +type P64EvidenceTests () = + + let samplePlan () = VillageArt.sampleRenderPlan () + + [<TestMethod>] + member _.OverviewUpperBandIsDenselyPopulated () = + let plan = samplePlan () + let upper = + plan.Props + |> List.filter (fun prop -> prop.Kind <> VillageArt.House && prop.Position.Y >= 0 && prop.Position.Y <= 6) + let kinds = upper |> List.map (fun prop -> prop.Kind) |> List.distinct + Assert.IsTrue(upper.Length >= 8, sprintf "上半部补种不足:%d" upper.Length) + Assert.IsTrue(kinds.Length >= 4, sprintf "上半部地物种类不足:%A" kinds) + for kind in [ VillageArt.VegetablePatch; VillageArt.BambooGrove; VillageArt.ShrubPatch; VillageArt.FlowerBush ] do + Assert.IsTrue(kinds |> List.contains kind, sprintf "上半部缺少 %A" kind) + // 北侧田埂小径贯通 x0..19。 + for x in 0 .. 19 do + Assert.IsTrue( + plan.Grounds |> List.contains ({ X = x; Y = 0 }, VillageArt.StonePath), + sprintf "北侧小径缺格 (%d,0)" x) + + [<TestMethod>] + member _.BridgeAbutmentsFlankTheSingleSampleBridge () = + let plan = samplePlan () + let abutments = VillageArt.sampleBridgeAbutmentTiles plan + Assert.AreEqual<int>(4, abutments.Length) + Assert.AreEqual<int>(4, (abutments |> List.distinct |> List.length)) + let bridgeTiles = + plan.Props + |> List.filter (fun prop -> prop.Kind = VillageArt.Bridge) + |> List.collect (fun prop -> + [ for dy in 0 .. 2 -> ({ X = prop.Position.X; Y = prop.Position.Y + dy } : TilePosition) ]) + |> List.map (VillageArt.worldTile plan) + for tile in abutments do + Assert.IsFalse(bridgeTiles |> List.contains tile, "护岸石不得压在桥面上") + + [<TestMethod>] + member _.InteriorLowerBandGainsFurniture () = + let plan = samplePlan () + let kinds = plan.Interior.Elements |> List.map (fun element -> element.Kind) + Assert.AreEqual<int>(8, plan.Interior.Elements.Length) + for kind in [ VillageArt.Chair; VillageArt.Stool; VillageArt.BedFoot; VillageArt.Teapot ] do + Assert.IsTrue(kinds |> List.contains kind, sprintf "内景缺少 %A" kind) diff --git a/src/LivingVillage.Desktop.Tests/PrototypeTests.fs b/src/LivingVillage.Desktop.Tests/PrototypeTests.fs index 55de3c8..da81f0e 100644 --- a/src/LivingVillage.Desktop.Tests/PrototypeTests.fs +++ b/src/LivingVillage.Desktop.Tests/PrototypeTests.fs @@ -460,7 +460,8 @@ type PrototypeTests () = Assert.IsTrue(first.Grounds |> List.exists (fun (_, kind) -> kind = VillageArt.Water)) Assert.IsTrue(first.Grounds |> List.exists (fun (_, kind) -> kind = VillageArt.StonePath)) Assert.IsTrue(first.Props |> List.exists (fun prop -> prop.Kind = VillageArt.Bridge)) - Assert.AreEqual<int>(4, first.Interior.Elements.Length) + // P64 补入椅/凳/床尾凳/壶 4 件家具 → 内景元素 4 → 8。 + Assert.AreEqual<int>(8, first.Interior.Elements.Length) [<TestMethod>] member _.HouseFacadeCoversRoofEaveAndWalledDoorRow () = @@ -474,8 +475,9 @@ type PrototypeTests () = Assert.IsTrue(footprint.Contains({ X = door.X + dx; Y = door.Y - 1 } : TilePosition), sprintf "missing eave tile dx=%d" dx) Assert.IsTrue(footprint.Contains({ X = door.X + dx; Y = door.Y } : TilePosition), sprintf "missing wall tile dx=%d" dx) // 12 house + 3 bridge + 3 bamboo + 2 garden + 2x2 willow + 2 shrub + 2 flowers + 2 reeds - // + 1 bench + 2 lanterns + 2 stone lanterns + 1 water vat + 1 market stall (P17). - Assert.AreEqual<int>(37, footprint.Count) + // + 1 bench + 2 lanterns + 2 stone lanterns + 1 water vat + 1 market stall (P17) + // + P64 上半部补种 4 菜畦(2格)+2 竹丛(3格)+2 灌木+2 花丛 = 37 + 18 = 55。 + Assert.AreEqual<int>(55, footprint.Count) [<TestMethod>] member _.VegetationAndRiversidePropsDecorateTheScene () = |
