si-m1-face-package/Documentation~/SDK_Mock_And_Testing.zh-CN.md

29 lines
863 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Mock 与测试
English documentation: [SDK_Mock_And_Testing.md](SDK_Mock_And_Testing.md).
公开 DLL-only 包在 `Aisu.SIM1.Face.Runtime.dll` 中包含运行时 Mock 支持,但不包含 EditMode 测试源码。
## Editor Mock
无真实硬件进行 Editor 联调时,在 `FaceSdkSettings` 中启用:
```text
Use Mock In Editor = true
```
启用后SDK 在 Unity Editor 中使用内置 Mock 通信层,不会打开真实串口。
## 真实硬件验证
验证真实 SI-M1 硬件时:
1. 设置 `Use Mock In Editor = false`
2. 配置 `Editor Port Name``Editor Baud Rate``Editor Read Buffer Size`
3. 在场景中创建 `FaceModuleManager`
4. 调用 `Open()`,然后等待 `WaitReadyAsync()` 或处理 `OnReady`
## 自动化测试
内部 EditMode 测试保留在私有开发 SDK 仓库中,不随 DLL-only 公开包发布。