docs(uns): clarify HasLazyChildren + cluster EntityId, add tie-break test (review I1/I2/M2)
This commit is contained in:
@@ -43,6 +43,7 @@ public sealed class UnsTreeAssemblyTests
|
||||
|
||||
var cluster = tree.Single().Children.Single();
|
||||
cluster.Key.ShouldBe("clu:c1");
|
||||
cluster.EntityId.ShouldBe("c1");
|
||||
|
||||
var area = cluster.Children.Single();
|
||||
area.Kind.ShouldBe(UnsNodeKind.Area);
|
||||
@@ -120,9 +121,12 @@ public sealed class UnsTreeAssemblyTests
|
||||
public void Build_orders_deterministically()
|
||||
{
|
||||
// Two enterprises out of order; clusters/areas/lines/equipment scrambled.
|
||||
// Two clusters with identical Name but different ClusterId to verify tie-break ordering.
|
||||
var clusters = new[]
|
||||
{
|
||||
new ClusterRow("cZ", "zeta", "SiteZ", "Zeta"),
|
||||
new ClusterRow("c9", "zeta", "SiteZ", "Zeta"),
|
||||
new ClusterRow("c8", "zeta", "SiteZ", "Zeta"),
|
||||
new ClusterRow("c2", "alpha", "Site2", "Bravo"),
|
||||
new ClusterRow("c1", "alpha", "Site1", "Alpha"),
|
||||
};
|
||||
@@ -162,5 +166,9 @@ public sealed class UnsTreeAssemblyTests
|
||||
// Equipment under l1 ordered by Name then EquipmentId: "EquipA"(e1) < "EquipB"(e2).
|
||||
var l1 = a1.Children.Single(l => l.Key == "line:l1");
|
||||
l1.Children.Select(eq => eq.Key).ShouldBe(new[] { "eq:e1", "eq:e2" });
|
||||
|
||||
// Clusters with the same Name tie-break by ClusterId ordinal: "c8" < "c9" < "cZ".
|
||||
var zetaEnt = tree.Single(e => e.Key == "ent:zeta");
|
||||
zetaEnt.Children.Select(c => c.Key).ShouldBe(new[] { "clu:c8", "clu:c9", "clu:cZ" });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user