Apply code style formatting and restore partial modifiers on Avalonia views
Linter/formatter pass across the full codebase. Restores required partial keyword on AXAML code-behind classes that the formatter incorrectly removed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -9,13 +9,25 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.OpcUa
|
||||
public class AddressSpaceDiffTests
|
||||
{
|
||||
private static GalaxyObjectInfo Obj(int id, string tag, int parent = 0, bool isArea = false)
|
||||
=> new GalaxyObjectInfo { GobjectId = id, TagName = tag, BrowseName = tag, ContainedName = tag, ParentGobjectId = parent, IsArea = isArea };
|
||||
{
|
||||
return new GalaxyObjectInfo
|
||||
{
|
||||
GobjectId = id, TagName = tag, BrowseName = tag, ContainedName = tag, ParentGobjectId = parent,
|
||||
IsArea = isArea
|
||||
};
|
||||
}
|
||||
|
||||
private static GalaxyAttributeInfo Attr(int gobjectId, string name, string tagName = "Obj", int mxDataType = 5)
|
||||
=> new GalaxyAttributeInfo { GobjectId = gobjectId, AttributeName = name, FullTagReference = $"{tagName}.{name}", MxDataType = mxDataType, TagName = tagName };
|
||||
{
|
||||
return new GalaxyAttributeInfo
|
||||
{
|
||||
GobjectId = gobjectId, AttributeName = name, FullTagReference = $"{tagName}.{name}",
|
||||
MxDataType = mxDataType, TagName = tagName
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that identical Galaxy hierarchy and attribute snapshots produce no incremental rebuild work.
|
||||
/// Verifies that identical Galaxy hierarchy and attribute snapshots produce no incremental rebuild work.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void NoChanges_ReturnsEmptySet()
|
||||
@@ -28,7 +40,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.OpcUa
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that newly deployed Galaxy objects are flagged for OPC UA subtree creation.
|
||||
/// Verifies that newly deployed Galaxy objects are flagged for OPC UA subtree creation.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void AddedObject_Detected()
|
||||
@@ -43,7 +55,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.OpcUa
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that removed Galaxy objects are flagged so their OPC UA subtree can be torn down.
|
||||
/// Verifies that removed Galaxy objects are flagged so their OPC UA subtree can be torn down.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void RemovedObject_Detected()
|
||||
@@ -58,13 +70,14 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.OpcUa
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that browse-name changes are treated as address-space changes for the affected Galaxy object.
|
||||
/// Verifies that browse-name changes are treated as address-space changes for the affected Galaxy object.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ModifiedObject_BrowseNameChange_Detected()
|
||||
{
|
||||
var oldH = new List<GalaxyObjectInfo> { Obj(1, "A") };
|
||||
var newH = new List<GalaxyObjectInfo> { new GalaxyObjectInfo { GobjectId = 1, TagName = "A", BrowseName = "A_Renamed", ContainedName = "A" } };
|
||||
var newH = new List<GalaxyObjectInfo>
|
||||
{ new() { GobjectId = 1, TagName = "A", BrowseName = "A_Renamed", ContainedName = "A" } };
|
||||
var a = new List<GalaxyAttributeInfo>();
|
||||
|
||||
var changed = AddressSpaceDiff.FindChangedGobjectIds(oldH, a, newH, a);
|
||||
@@ -72,13 +85,17 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.OpcUa
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that parent changes are treated as subtree moves that require rebuilding the affected object.
|
||||
/// Verifies that parent changes are treated as subtree moves that require rebuilding the affected object.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ModifiedObject_ParentChange_Detected()
|
||||
{
|
||||
var oldH = new List<GalaxyObjectInfo> { Obj(1, "A"), Obj(2, "B", parent: 1) };
|
||||
var newH = new List<GalaxyObjectInfo> { Obj(1, "A"), new GalaxyObjectInfo { GobjectId = 2, TagName = "B", BrowseName = "B", ContainedName = "B", ParentGobjectId = 0 } };
|
||||
var oldH = new List<GalaxyObjectInfo> { Obj(1, "A"), Obj(2, "B", 1) };
|
||||
var newH = new List<GalaxyObjectInfo>
|
||||
{
|
||||
Obj(1, "A"),
|
||||
new() { GobjectId = 2, TagName = "B", BrowseName = "B", ContainedName = "B", ParentGobjectId = 0 }
|
||||
};
|
||||
var a = new List<GalaxyAttributeInfo>();
|
||||
|
||||
var changed = AddressSpaceDiff.FindChangedGobjectIds(oldH, a, newH, a);
|
||||
@@ -86,7 +103,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.OpcUa
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that adding a Galaxy attribute marks the owning object for OPC UA variable rebuild.
|
||||
/// Verifies that adding a Galaxy attribute marks the owning object for OPC UA variable rebuild.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void AttributeAdded_Detected()
|
||||
@@ -100,7 +117,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.OpcUa
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that removing a Galaxy attribute marks the owning object for OPC UA variable rebuild.
|
||||
/// Verifies that removing a Galaxy attribute marks the owning object for OPC UA variable rebuild.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void AttributeRemoved_Detected()
|
||||
@@ -114,7 +131,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.OpcUa
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that changes to attribute field metadata such as MX data type trigger rebuild of the owning object.
|
||||
/// Verifies that changes to attribute field metadata such as MX data type trigger rebuild of the owning object.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void AttributeFieldChange_Detected()
|
||||
@@ -128,21 +145,23 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.OpcUa
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that security-classification changes are treated as address-space changes for the owning attribute.
|
||||
/// Verifies that security-classification changes are treated as address-space changes for the owning attribute.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void AttributeSecurityChange_Detected()
|
||||
{
|
||||
var h = new List<GalaxyObjectInfo> { Obj(1, "A") };
|
||||
var oldA = new List<GalaxyAttributeInfo> { new GalaxyAttributeInfo { GobjectId = 1, AttributeName = "X", FullTagReference = "A.X", SecurityClassification = 1 } };
|
||||
var newA = new List<GalaxyAttributeInfo> { new GalaxyAttributeInfo { GobjectId = 1, AttributeName = "X", FullTagReference = "A.X", SecurityClassification = 2 } };
|
||||
var oldA = new List<GalaxyAttributeInfo>
|
||||
{ new() { GobjectId = 1, AttributeName = "X", FullTagReference = "A.X", SecurityClassification = 1 } };
|
||||
var newA = new List<GalaxyAttributeInfo>
|
||||
{ new() { GobjectId = 1, AttributeName = "X", FullTagReference = "A.X", SecurityClassification = 2 } };
|
||||
|
||||
var changed = AddressSpaceDiff.FindChangedGobjectIds(h, oldA, h, newA);
|
||||
changed.ShouldContain(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that subtree expansion includes all descendants of a changed Galaxy object.
|
||||
/// Verifies that subtree expansion includes all descendants of a changed Galaxy object.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ExpandToSubtrees_IncludesChildren()
|
||||
@@ -150,9 +169,9 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.OpcUa
|
||||
var h = new List<GalaxyObjectInfo>
|
||||
{
|
||||
Obj(1, "Root"),
|
||||
Obj(2, "Child", parent: 1),
|
||||
Obj(3, "Grandchild", parent: 2),
|
||||
Obj(4, "Sibling", parent: 1),
|
||||
Obj(2, "Child", 1),
|
||||
Obj(3, "Grandchild", 2),
|
||||
Obj(4, "Sibling", 1),
|
||||
Obj(5, "Unrelated")
|
||||
};
|
||||
|
||||
@@ -167,7 +186,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.OpcUa
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that subtree expansion does not introduce unrelated nodes when the changed object is already a leaf.
|
||||
/// Verifies that subtree expansion does not introduce unrelated nodes when the changed object is already a leaf.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ExpandToSubtrees_LeafNode_NoExpansion()
|
||||
@@ -175,8 +194,8 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.OpcUa
|
||||
var h = new List<GalaxyObjectInfo>
|
||||
{
|
||||
Obj(1, "Root"),
|
||||
Obj(2, "Child", parent: 1),
|
||||
Obj(3, "Sibling", parent: 1)
|
||||
Obj(2, "Child", 1),
|
||||
Obj(3, "Sibling", 1)
|
||||
};
|
||||
|
||||
var changed = new HashSet<int> { 2 };
|
||||
@@ -187,4 +206,4 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.OpcUa
|
||||
expanded.ShouldNotContain(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user