给全部源码补中文注释,并新增代码导览
- 67 个 .cs 文件加中文注释:每个文件顶部说明职责/调用方/线程与节拍/ 已知限制/「要改什么就改哪里」,字段与方法逐条一行说明,复杂逻辑内插关键步骤 - 纯注释改动:脚本校验所有新增行都是注释、无非注释改动(仅 2 个文件的 BOM 随新头部注释下移,文件仍以 BOM 开头) - 新增 docs/代码导览.md:模块地图、「我要改 X 看哪个文件」对照表、易踩的坑、 悬浮条显示规则、测试与验收指引 - 编译通过,回归测试 23/23 通过 Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
// =====================================================================================
|
||||
// PersistenceTests —— 监控条目与设置的持久化 / 迁移 / 缺省值 回归。
|
||||
//
|
||||
// 覆盖范围:ControlMonitorStore 的 Save/Load(XPath 不落盘动态字段、拒绝旧格式写入)、
|
||||
// AppSettingsStore 的 Load/Save(旧 UiaPath 读取、缺失区段与刷新间隔缺省值、
|
||||
// 悬浮条 Enabled/RequireWindowVisible 的“缺省启用 vs 显式停用”区分)。
|
||||
//
|
||||
// 为什么这样测:全部在临时目录里读写 JSON 文件、用内存对象断言,不涉及 UIA / GUI;
|
||||
// 每个用例用 TemporaryDirectory 隔离,绝不读写真实用户配置。
|
||||
//
|
||||
// 新增用例:加到 Register(...) 列表并实现 private static void 方法,断言走 Check.*。
|
||||
// =====================================================================================
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -11,9 +23,13 @@ namespace PacsWinUia.RegressionTests
|
||||
{
|
||||
public static void Register(IList<KeyValuePair<string, Action>> tests)
|
||||
{
|
||||
// 防:RuntimeId/Value 等动态字段被写进 JSON、Obsolete 标志残留、Disabled 未落盘。
|
||||
tests.Add(new KeyValuePair<string, Action>("Store saves XPath without dynamic UIA fields and copies flags", StoreXPath));
|
||||
// 防:旧 UiaPath 定义被读入后又被静默改写/覆盖旧文件,或修正后不持久化。
|
||||
tests.Add(new KeyValuePair<string, Action>("Store reads legacy UiaPath definitions", StoreLegacy));
|
||||
// 防:设置缺省刷新间隔不再是 300ms,或缺失的区段未被补全。
|
||||
tests.Add(new KeyValuePair<string, Action>("Settings missing refresh interval defaults to 300", SettingsDefault));
|
||||
// 防:悬浮条缺省启用被误判为显式停用(或反之)。
|
||||
tests.Add(new KeyValuePair<string, Action>("Floating JSON missing defaults differs from explicit disabled", FloatingDefaults));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user