test(adminui): migrate AdminUI.Tests to v3 greenfield schema + Batch-1 stubs
Migrate tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests (was 358 build errors) to the v3 Raw-only Tag schema and the Batch-1 AdminUI stubs. Production untouched. - Driver-page serialization tests: drop the retired pre-declared Tags editor (page *TagRow types + DriverOptions.Tags); multi-device pages keep their Devices editor (ToOptions(devices)). Enum-serialization round-trip coverage (CpuType/ModbusFamily/MelsecFamily/AbCipPlcFamily/AbLegacyPlcFamily/FocasCncSeries) preserved intact. - UnsTreeTestDb: reseed to v3 (Device->Tag raw slice, no EquipmentId/DriverInstanceId on Tag, no Namespace). - UnsTreeService tag tests: assert Batch-1 stubs (CreateTag/UpdateTag refusal, empty tag/tag-driver lists); DeleteTag stays live against a raw Tag. - Equipment #122 guard retained (validates input driver vs line cluster); drop the retired persisted-binding assertions + NamespaceId seeds. Area/Line #122 driver- orphan guard retired -> assert cross-cluster move now succeeds. - DeleteCluster: drop the deleted-Namespace child-check test. - OpcUaClientTagConfigModel/TagConfigValidator: address key FullName -> nodeId. - ScriptTagCatalog: project surviving Name/DataType/TagConfig; DriverInstanceId null. - VirtualTag {{equip}} equipment-tag-derived base is dark -> 3 tests skipped (Batch-3). Result: build green; 507 passed / 3 skipped / 0 failed.
This commit is contained in:
@@ -108,7 +108,6 @@ public sealed class UnsTreeServiceLoadEditTests
|
||||
{
|
||||
DriverInstanceId = "DRV-B",
|
||||
ClusterId = UnsTreeTestDb.PopulatedClusterId,
|
||||
NamespaceId = "NS-1",
|
||||
Name = "modbus-b",
|
||||
DriverType = "Modbus",
|
||||
DriverConfig = "{}",
|
||||
@@ -117,7 +116,6 @@ public sealed class UnsTreeServiceLoadEditTests
|
||||
{
|
||||
DriverInstanceId = "DRV-A",
|
||||
ClusterId = UnsTreeTestDb.PopulatedClusterId,
|
||||
NamespaceId = "NS-1",
|
||||
Name = "galaxy-a",
|
||||
DriverType = "Galaxy",
|
||||
DriverConfig = "{}",
|
||||
@@ -127,7 +125,6 @@ public sealed class UnsTreeServiceLoadEditTests
|
||||
{
|
||||
DriverInstanceId = "DRV-OTHER",
|
||||
ClusterId = UnsTreeTestDb.EmptyClusterId,
|
||||
NamespaceId = "NS-2",
|
||||
Name = "other",
|
||||
DriverType = "S7",
|
||||
DriverConfig = "{}",
|
||||
@@ -144,7 +141,11 @@ public sealed class UnsTreeServiceLoadEditTests
|
||||
drivers[1].Display.ShouldBe("DRV-B — modbus-b (Modbus)");
|
||||
}
|
||||
|
||||
/// <summary>Loading a seeded tag maps its fields, owning equipment, and a non-empty RowVersion.</summary>
|
||||
/// <summary>
|
||||
/// Loading a seeded Raw tag maps its surviving fields (Name/DataType/AccessLevel/TagConfig) and a
|
||||
/// non-empty RowVersion. v3: Tag is Raw-only — the equipment + driver bindings were retired, so the
|
||||
/// DTO's <c>EquipmentId</c> / <c>DriverInstanceId</c> project as empty strings.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task LoadTag_returns_dto()
|
||||
{
|
||||
@@ -154,9 +155,9 @@ public sealed class UnsTreeServiceLoadEditTests
|
||||
|
||||
dto.ShouldNotBeNull();
|
||||
dto.TagId.ShouldBe("TAG-1");
|
||||
dto.EquipmentId.ShouldBe(UnsTreeTestDb.SeededEquipmentId);
|
||||
dto.EquipmentId.ShouldBe(string.Empty);
|
||||
dto.Name.ShouldBe("speed");
|
||||
dto.DriverInstanceId.ShouldBe("DRV-1");
|
||||
dto.DriverInstanceId.ShouldBe(string.Empty);
|
||||
dto.DataType.ShouldBe("Float");
|
||||
dto.AccessLevel.ShouldBe(TagAccessLevel.Read);
|
||||
dto.TagConfig.ShouldBe("{}");
|
||||
|
||||
Reference in New Issue
Block a user