Commit Graph

2 Commits (main)

Author SHA1 Message Date
haoliang 089f3e502a 添加 BrandFieldMappingRepositoryTests 测试用例; 扩展 BrandServiceTests/BrandControllerTests 的测试覆盖 IsEnabled 字段 12 hours ago
haoliang 16016d0df7 新增CncWebApi.Tests:14个控制器127个测试全部通过
- ControllerFactory:封装14个Controller的创建(含完整Repository→Service→Controller依赖链)
- TestDb:测试数据库辅助(TruncateAll+SeedData+SetRealPasswordHash+辅助查询)
- DatabaseCollection:xUnit串行测试集合(共享cnc_test库)
- 14个Controller测试文件覆盖所有API端点:
  Health(1) + Auth(6) + Brand(15) + Machine(10) + CollectAddress(10) +
  Worker(13) + Dashboard(9) + Settings(15) + Production(6) + Alert(7) +
  Log(4) + ScreenConfig(12) + Screen(11) + Option(8) = 127个测试
- 直接实例化Controller调用方法,不经过HTTP管线
- 使用真实数据库(cnc_test库),与Service.Tests共享同一测试库
1 week ago