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:
Joseph Doherty
2026-07-15 21:50:48 -04:00
parent aaba2ebd66
commit 6a616a1ab2
22 changed files with 266 additions and 1029 deletions
@@ -105,7 +105,6 @@ public sealed class UnsTreeServiceDeleteClusterTests
{
DriverInstanceId = "DRV-CL",
ClusterId = "CL-DRV",
NamespaceId = "NS-1",
Name = "drv",
DriverType = "Modbus",
DriverConfig = "{}",
@@ -151,33 +150,10 @@ public sealed class UnsTreeServiceDeleteClusterTests
verify.ServerClusters.Any(c => c.ClusterId == "CL-NODE").ShouldBeTrue();
}
/// <summary>A cluster with a namespace refuses deletion with a friendly message and stays put.</summary>
[Fact]
public async Task DeleteCluster_with_namespace_refuses_and_keeps_row()
{
var (service, dbName) = Fresh();
using (var db = UnsTreeTestDb.CreateNamed(dbName))
{
db.ServerClusters.Add(NewCluster("CL-NS", "zb"));
db.Namespaces.Add(new Namespace
{
NamespaceId = "NS-CL",
ClusterId = "CL-NS",
Kind = NamespaceKind.Equipment,
NamespaceUri = "urn:zb:cl-ns:equipment",
});
db.SaveChanges();
}
var result = await service.DeleteClusterAsync("CL-NS");
result.Ok.ShouldBeFalse();
result.Error.ShouldNotBeNull();
result.Error.ShouldContain("CL-NS");
using var verify = UnsTreeTestDb.CreateNamed(dbName);
verify.ServerClusters.Any(c => c.ClusterId == "CL-NS").ShouldBeTrue();
}
// v3 Batch-1: the Namespace entity was deleted (Raw/UNS split), so DescribeClusterChildrenAsync
// no longer carries a namespace child-check. The former DeleteCluster_with_namespace_refuses test
// was removed. The cluster-nodes / UNS-areas / driver-instances refuse-if-children checks (above)
// remain the enforced set.
// ----- DeleteEnterprise -----