blob: 9000a049858457b77aa5935ba54e35b0ab45b41f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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)
|