summaryrefslogtreecommitdiff
path: root/src/LivingVillage.Desktop.Tests/P69CopyAuditTests.fs
blob: cd5e221b64ade455b52e1a0cd6ae3cf941659152 (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
namespace LivingVillage.Desktop.Tests

open Microsoft.VisualStudio.TestTools.UnitTesting
open LivingVillage.Kernel
open LivingVillage.Kernel.Sim
open LivingVillage.Desktop

/// P69(文案统一审校):把玩家可见中文文案里不一致的措辞/大小写/留白拉齐,并补回归断言。
/// 本单只改字符串字面量与相关断言;不改逻辑、不改 Kernel/Sim。
[<TestClass>]
type P69CopyAuditTests () =

    [<TestMethod>]
    member _.PanelStatusWordingIsUnified () =
        // 「需求面板已打开 / 任务面板已打开」同一句式;年鉴原为「年鉴已打开」,统一为「年鉴面板已打开」。
        Assert.AreEqual<string>(
            "年鉴面板已打开",
            M5Interaction.statusText { M5Interaction.initial with Status = "chronicle" })
        Assert.AreEqual<string>(
            "需求面板已打开",
            M5Interaction.statusText { M5Interaction.initial with Status = "needs panel open" })
        Assert.AreEqual<string>(
            "任务面板已打开",
            M5Interaction.statusText { M5Interaction.initial with Status = "task panel open" })
        Assert.IsTrue(ChineseText.requiredUiLabels |> List.contains "年鉴面板已打开")
        Assert.IsFalse(ChineseText.requiredUiLabels |> List.contains "年鉴已打开")

    [<TestMethod>]
    member _.TradeShortageUsesStockWording () =
        // 交易缺货口径统一为「库存不足」(与对话交易失败名一致),不再用「背包不足」。
        let state = { Occupation.stateOf Occupation.Farmer with Backpack = [ (Food, 1) ] }
        let world = WorldBootstrap.initialWorldWithOccupation false 42UL 4 (Some state)
        let outcome = PlayerTrade.sell (Some state) (NpcId 0) Food 3 world
        Assert.IsFalse(outcome.Succeeded, "shortage sale must not succeed")
        Assert.AreEqual<string>("库存不足", outcome.Message)