refactor(adminui): delete the dead LoadTagsForEquipmentAsync surface (R04 S4)
v3 retired the equipment-Tag binding; IUnsTreeService.LoadTagsForEquipmentAsync always returned empty, had no production caller, and EquipmentTagRow plus the always-zero tagCounts / EquipmentRow.TagCount plumbing existed only to feed it. All removed; the equipment badge count (virtual tags) is unchanged. Refs #745 Claude-Session: https://claude.ai/code/session_01Ub9hGmYLQvn9XETzw7CMsT
This commit is contained in:
@@ -37,7 +37,7 @@ public sealed class UnsTreeAssemblyTests
|
||||
var clusters = new[] { new ClusterRow("c1", "zb", "SiteA", "Alpha") };
|
||||
var areas = new[] { new AreaRow("a1", "c1", "AreaOne") };
|
||||
var lines = new[] { new LineRow("l1", "a1", "LineOne") };
|
||||
var equipment = new[] { new EquipmentRow("e1", "l1", "MC-1", "EquipOne", 0, 0) };
|
||||
var equipment = new[] { new EquipmentRow("e1", "l1", "MC-1", "EquipOne", 0) };
|
||||
|
||||
var tree = UnsTreeAssembly.Build(clusters, areas, lines, equipment);
|
||||
|
||||
@@ -75,8 +75,8 @@ public sealed class UnsTreeAssemblyTests
|
||||
var lines = new[] { new LineRow("l1", "a1", "LineOne") };
|
||||
var equipment = new[]
|
||||
{
|
||||
new EquipmentRow("e1", "l1", "MC-1", "WithChildren", 2, 1),
|
||||
new EquipmentRow("e2", "l1", "MC-2", "Empty", 0, 0),
|
||||
new EquipmentRow("e1", "l1", "MC-1", "WithChildren", 3),
|
||||
new EquipmentRow("e2", "l1", "MC-2", "Empty", 0),
|
||||
};
|
||||
|
||||
var tree = UnsTreeAssembly.Build(clusters, areas, lines, equipment);
|
||||
@@ -84,7 +84,7 @@ public sealed class UnsTreeAssemblyTests
|
||||
|
||||
// Equipment is a tree leaf that links to its own detail page, so it never carries an
|
||||
// expander — HasLazyChildren is always false regardless of its tag/virtual-tag count.
|
||||
// The ChildCount badge still reflects tags + virtual tags.
|
||||
// The ChildCount badge reflects its virtual tags.
|
||||
var withChildren = line.Children.Single(e => e.Key == "eq:e1");
|
||||
withChildren.ChildCount.ShouldBe(3);
|
||||
withChildren.HasLazyChildren.ShouldBeFalse();
|
||||
@@ -145,8 +145,8 @@ public sealed class UnsTreeAssemblyTests
|
||||
};
|
||||
var equipment = new[]
|
||||
{
|
||||
new EquipmentRow("e2", "l1", "MC-2", "EquipB", 0, 0),
|
||||
new EquipmentRow("e1", "l1", "MC-1", "EquipA", 0, 0),
|
||||
new EquipmentRow("e2", "l1", "MC-2", "EquipB", 0),
|
||||
new EquipmentRow("e1", "l1", "MC-1", "EquipA", 0),
|
||||
};
|
||||
|
||||
var tree = UnsTreeAssembly.Build(clusters, areas, lines, equipment);
|
||||
|
||||
+2
-14
@@ -14,16 +14,8 @@ public sealed class UnsTreeServiceEquipmentChildRowsTests
|
||||
return new UnsTreeService(UnsTreeTestDb.Factory(dbName));
|
||||
}
|
||||
|
||||
// v3 Batch-1: the equipment↔Tag binding was retired (Tag is Raw-only; authoring moved to the Raw
|
||||
// tree in Batch 2). LoadTagsForEquipmentAsync is a stub that always returns empty — no equipment
|
||||
// has bound driver tags to list. The former in-name-order / EquipmentId-scoping assertions moved
|
||||
// with the authoring surface to the Batch-2 Raw-tree tests.
|
||||
[Fact]
|
||||
public async Task LoadTagsForEquipment_returns_empty_stub()
|
||||
{
|
||||
var rows = await SeededService().LoadTagsForEquipmentAsync(UnsTreeTestDb.SeededEquipmentId);
|
||||
rows.ShouldBeEmpty();
|
||||
}
|
||||
// v3 Batch-1 retired the equipment↔Tag binding; the always-empty LoadTagsForEquipmentAsync stub and
|
||||
// its EquipmentTagRow were deleted (R04 S4). Equipment tags are UnsTagReference rows now.
|
||||
|
||||
[Fact]
|
||||
public async Task LoadVirtualTagsForEquipment_returns_vtags_in_name_order()
|
||||
@@ -34,8 +26,4 @@ public sealed class UnsTreeServiceEquipmentChildRowsTests
|
||||
rows[0].Name.ShouldBe("computed");
|
||||
rows[0].DataType.ShouldBe("Double");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task LoadTagsForEquipment_empty_for_unknown_equipment()
|
||||
=> (await SeededService().LoadTagsForEquipmentAsync("EQ-NONE")).ShouldBeEmpty();
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace ZB.MOM.WW.OtOpcUa.AdminUI.Tests.Uns;
|
||||
/// <c>FolderPath</c>), the <c>Namespace</c>/<c>NamespaceKind</c> entities were deleted, and tag
|
||||
/// authoring moved to the Raw tree (<c>/raw</c>) in Batch 2. So <see cref="UnsTreeService"/>'s
|
||||
/// <c>CreateTagAsync</c> / <c>UpdateTagAsync</c> now return a uniform Batch-1 refusal, and
|
||||
/// <c>LoadTagsForEquipmentAsync</c> / <c>LoadTagDriversForEquipmentAsync</c> return empty. The tests
|
||||
/// <c>LoadTagDriversForEquipmentAsync</c> returns empty. The tests
|
||||
/// below assert that stub contract (preserving the intent of the old CRUD-guard / driver-loader
|
||||
/// tests) plus the still-live <c>DeleteTagAsync</c> path (which continues to remove a raw Tag row).
|
||||
/// </summary>
|
||||
@@ -153,16 +153,6 @@ public sealed class UnsTreeServiceTagTests
|
||||
|
||||
// ----- Per-equipment loaders: retired → empty -----
|
||||
|
||||
/// <summary>The per-equipment tag list is retired (Tag is Raw-only) → always empty.</summary>
|
||||
[Fact]
|
||||
public async Task LoadTagsForEquipment_returns_empty()
|
||||
{
|
||||
var (service, dbName) = Fresh();
|
||||
SeedHierarchy(dbName);
|
||||
|
||||
(await service.LoadTagsForEquipmentAsync("EQ-1")).ShouldBeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>The per-equipment candidate-driver loader is retired (equipment↔driver binding gone) → always empty.</summary>
|
||||
[Fact]
|
||||
public async Task LoadTagDriversForEquipment_returns_empty()
|
||||
|
||||
Reference in New Issue
Block a user