test: 添加 CLI 命令单元测试
This commit is contained in:
@@ -48,6 +48,21 @@
|
||||
| ORM | Entity Framework Core | 8.0 |
|
||||
| 数据库 | SQLite / PostgreSQL | - |
|
||||
| CLI | System.CommandLine | 2.0-beta4 |
|
||||
| 测试 | NUnit | 4.2 |
|
||||
|
||||
---
|
||||
|
||||
## 测试
|
||||
|
||||
CLI 单元测试项目位于 `tests/Gpulse.WCT.DataAnalyzer.Tests`,使用 NUnit + 内存 SQLite:
|
||||
|
||||
- 直接实例化 `ParseCommand` / `AggregateCommand` / `ExportCommand` / `CleanCommand` / `AnalyzeCommand`(构造方式与 `Program.Main` 一致),验证命令绑定、参数解析与输出。
|
||||
- 每个测试独立的「本地库/发布库」内存连接 + 临时日志 fixture 目录,互不污染。
|
||||
- 不启动完整 Host/Serilog,仅覆盖 CLI 命令层行为。
|
||||
|
||||
```bash
|
||||
dotnet test Gpulse.WCT.DataAnalyzer.sln
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user