本表定義 5E 第一批程式實作後需要通過的測試與停止線。確認前只作為測試規格,不修改程式 repo。
1. 建議測試案例
| 編號 | 測試重點 |
|---|---|
| 1 | service options 不可為空,且不得包含敏感資訊。 |
| 2 | 預設不啟用 Windows Service path,既有 console smoke path 保持可用。 |
| 3 | service hosting wrapper 啟動時呼叫 IServiceHostRuntime.Start()。 |
| 4 | service hosting wrapper 停止時呼叫 IServiceHostRuntime.Stop()。 |
| 5 | runtime start 失敗時回報可追蹤錯誤,不吞 exception。 |
| 6 | install / uninstall / start / stop script 若存在,預設必須拒絕執行。 |
2. 必跑測試
| 測試範圍 | 指令 |
|---|---|
| ServiceHost tests | dotnet test tests\HS.DeviceControl.ServiceHost.Tests\HS.DeviceControl.ServiceHost.Tests.csproj --no-restore |
| Application tests | dotnet test tests\HS.DeviceControl.Application.Tests\HS.DeviceControl.Application.Tests.csproj --no-restore |
| Solution tests | dotnet test HS.DeviceControl.sln --no-restore |
3. 停止線
- 不得自動執行 service create / delete。
- 不得寫入正式帳號、密碼、token、正式 IP 或正式網域。
- 不得新增 DB DDL、WebApi auth / Swagger、外部 DLL 載入或 plugin folder scan。
4. 結論
5E 第一批實作需先證明 ServiceHost 可以以可測試的 service hosting contract 承接 Windows Service 化;正式 service install、service account、recovery、正式 log / config path 與部署權限仍應作為後續 manual-only 驗收或獨立確認節點。