✨ feat(*): 更新 PLC 相关功能与配置
- 在 appConfig.json 中添加 EndianFormat 配置项并更新相关输入输出地址 - 修改 ResultCode 类型为 short,确保与 PLC 通信一致 - 新增 DesignTimePlcService 以支持设计时的 PLC 测试写入功能 - 更新 SystemSettingViewModel 和 DashboardPage 以支持手动测试写入 - 调整多个视图模型和服务以适应新的 PLC 写入逻辑 - 更新相关单元测试以验证新功能的正确性
This commit is contained in:
@@ -89,20 +89,20 @@ public sealed class LocalFileCheckProviderTests : IDisposable
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 文件名包含条码时,应返回命中文件路径。
|
||||
/// 文件名只包含条码但不等于模板生成文件名时,不应命中。
|
||||
/// </summary>
|
||||
/// <returns>异步测试任务。</returns>
|
||||
[Fact]
|
||||
public async Task CheckFileAsync_ShouldMatchFileNameContainingBarcode()
|
||||
public async Task CheckFileAsync_ShouldNotMatchFileNameContainingBarcodeOnly()
|
||||
{
|
||||
string filePath = Path.Combine(_rootPath, "prefix-PCB-002-result.dat");
|
||||
string filePath = Path.Combine(_rootPath, "abcd10.txt");
|
||||
await File.WriteAllTextAsync(filePath, "ok");
|
||||
var provider = CreateProvider();
|
||||
|
||||
FileCheckOutcome outcome = await provider.CheckFileAsync("PCB-002", CreateConfig(_rootPath), CancellationToken.None);
|
||||
FileCheckOutcome outcome = await provider.CheckFileAsync("abcd1", CreateConfig(_rootPath), CancellationToken.None);
|
||||
|
||||
Assert.True(outcome.Exists);
|
||||
Assert.Equal(filePath, outcome.MatchedFilePath);
|
||||
Assert.False(outcome.Exists);
|
||||
Assert.Empty(outcome.MatchedFilePath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user