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:
Joseph Doherty
2026-03-31 07:58:13 -04:00
parent 55ef854612
commit 41a6b66943
221 changed files with 4274 additions and 3823 deletions

View File

@@ -6,18 +6,17 @@ using Shouldly;
using Xunit;
using ZB.MOM.WW.LmxOpcUa.Host.Domain;
using ZB.MOM.WW.LmxOpcUa.Host.GalaxyRepository;
using ZB.MOM.WW.LmxOpcUa.Host.OpcUa;
using ZB.MOM.WW.LmxOpcUa.Tests.Helpers;
namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
{
/// <summary>
/// Verifies: Galaxy change detection → OnGalaxyChanged → address space rebuild
/// Verifies: Galaxy change detection → OnGalaxyChanged → address space rebuild
/// </summary>
public class ChangeDetectionToRebuildWiringTest
{
/// <summary>
/// Confirms that a changed deploy timestamp causes the change-detection pipeline to raise another rebuild signal.
/// Confirms that a changed deploy timestamp causes the change-detection pipeline to raise another rebuild signal.
/// </summary>
[Fact]
public async Task ChangedTimestamp_TriggersRebuild()
@@ -27,16 +26,20 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
LastDeployTime = new DateTime(2024, 1, 1),
Hierarchy = new List<GalaxyObjectInfo>
{
new GalaxyObjectInfo { GobjectId = 1, TagName = "Obj1", BrowseName = "Obj1", ParentGobjectId = 0, IsArea = false }
new() { GobjectId = 1, TagName = "Obj1", BrowseName = "Obj1", ParentGobjectId = 0, IsArea = false }
},
Attributes = new List<GalaxyAttributeInfo>
{
new GalaxyAttributeInfo { GobjectId = 1, TagName = "Obj1", AttributeName = "Attr1", FullTagReference = "Obj1.Attr1", MxDataType = 5, IsArray = false }
new()
{
GobjectId = 1, TagName = "Obj1", AttributeName = "Attr1", FullTagReference = "Obj1.Attr1",
MxDataType = 5, IsArray = false
}
}
};
var rebuildCount = 0;
var service = new ChangeDetectionService(repo, intervalSeconds: 1);
var service = new ChangeDetectionService(repo, 1);
service.OnGalaxyChanged += () => Interlocked.Increment(ref rebuildCount);
service.Start();
@@ -52,4 +55,4 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
service.Dispose();
}
}
}
}

View File

@@ -2,18 +2,17 @@ using System.Threading.Tasks;
using Shouldly;
using Xunit;
using ZB.MOM.WW.LmxOpcUa.Host.Domain;
using ZB.MOM.WW.LmxOpcUa.Host.OpcUa;
using ZB.MOM.WW.LmxOpcUa.Tests.Helpers;
namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
{
/// <summary>
/// Verifies: FakeMxProxy OnDataChange → MxAccessClient → OnTagValueChanged → node manager delivery
/// Verifies: FakeMxProxy OnDataChange → MxAccessClient → OnTagValueChanged → node manager delivery
/// </summary>
public class MxAccessToNodeManagerWiringTest
{
/// <summary>
/// Confirms that a simulated data change reaches the global tag-value-changed event.
/// Confirms that a simulated data change reaches the global tag-value-changed event.
/// </summary>
[Fact]
public async Task DataChange_ReachesGlobalHandler()
@@ -37,7 +36,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
}
/// <summary>
/// Confirms that a simulated data change reaches the stored per-tag subscription callback.
/// Confirms that a simulated data change reaches the stored per-tag subscription callback.
/// </summary>
[Fact]
public async Task DataChange_ReachesSubscriptionCallback()
@@ -52,4 +51,4 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
received.Value.Value.ShouldBe(99);
}
}
}
}

View File

@@ -9,12 +9,12 @@ using ZB.MOM.WW.LmxOpcUa.Tests.Helpers;
namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
{
/// <summary>
/// Verifies: OPC UA Read → NodeManager → IMxAccessClient.ReadAsync with correct full_tag_reference
/// Verifies: OPC UA Read → NodeManager → IMxAccessClient.ReadAsync with correct full_tag_reference
/// </summary>
public class OpcUaReadToMxAccessWiringTest
{
/// <summary>
/// Confirms that the resolved OPC UA read path uses the expected full Galaxy tag reference.
/// Confirms that the resolved OPC UA read path uses the expected full Galaxy tag reference.
/// </summary>
[Fact]
public async Task Read_ResolvesCorrectTagReference()
@@ -24,12 +24,24 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
var hierarchy = new List<GalaxyObjectInfo>
{
new GalaxyObjectInfo { GobjectId = 1, TagName = "TestMachine_001", BrowseName = "TestMachine_001", ParentGobjectId = 0, IsArea = false },
new GalaxyObjectInfo { GobjectId = 2, TagName = "DelmiaReceiver_001", ContainedName = "DelmiaReceiver", BrowseName = "DelmiaReceiver", ParentGobjectId = 1, IsArea = false }
new()
{
GobjectId = 1, TagName = "TestMachine_001", BrowseName = "TestMachine_001", ParentGobjectId = 0,
IsArea = false
},
new()
{
GobjectId = 2, TagName = "DelmiaReceiver_001", ContainedName = "DelmiaReceiver",
BrowseName = "DelmiaReceiver", ParentGobjectId = 1, IsArea = false
}
};
var attributes = new List<GalaxyAttributeInfo>
{
new GalaxyAttributeInfo { GobjectId = 2, TagName = "DelmiaReceiver_001", AttributeName = "DownloadPath", FullTagReference = "DelmiaReceiver_001.DownloadPath", MxDataType = 5, IsArray = false }
new()
{
GobjectId = 2, TagName = "DelmiaReceiver_001", AttributeName = "DownloadPath",
FullTagReference = "DelmiaReceiver_001.DownloadPath", MxDataType = 5, IsArray = false
}
};
var model = AddressSpaceBuilder.Build(hierarchy, attributes);
@@ -44,4 +56,4 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
vtq.Quality.ShouldBe(Quality.Good);
}
}
}
}

View File

@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Shouldly;
using Xunit;
@@ -10,12 +9,12 @@ using ZB.MOM.WW.LmxOpcUa.Tests.Helpers;
namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
{
/// <summary>
/// Verifies: OPC UA Write → NodeManager → IMxAccessClient.WriteAsync with correct tag+value
/// Verifies: OPC UA Write → NodeManager → IMxAccessClient.WriteAsync with correct tag+value
/// </summary>
public class OpcUaWriteToMxAccessWiringTest
{
/// <summary>
/// Confirms that the resolved OPC UA write path targets the expected Galaxy tag reference and payload.
/// Confirms that the resolved OPC UA write path targets the expected Galaxy tag reference and payload.
/// </summary>
[Fact]
public async Task Write_SendsCorrectTagAndValue()
@@ -24,11 +23,19 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
var hierarchy = new List<GalaxyObjectInfo>
{
new GalaxyObjectInfo { GobjectId = 1, TagName = "TestMachine_001", BrowseName = "TestMachine_001", ParentGobjectId = 0, IsArea = false }
new()
{
GobjectId = 1, TagName = "TestMachine_001", BrowseName = "TestMachine_001", ParentGobjectId = 0,
IsArea = false
}
};
var attributes = new List<GalaxyAttributeInfo>
{
new GalaxyAttributeInfo { GobjectId = 1, TagName = "TestMachine_001", AttributeName = "MachineCode", FullTagReference = "TestMachine_001.MachineCode", MxDataType = 5, IsArray = false }
new()
{
GobjectId = 1, TagName = "TestMachine_001", AttributeName = "MachineCode",
FullTagReference = "TestMachine_001.MachineCode", MxDataType = 5, IsArray = false
}
};
var model = AddressSpaceBuilder.Build(hierarchy, attributes);
@@ -38,7 +45,8 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
var result = await mxClient.WriteAsync(tagRef, "NEW_CODE");
result.ShouldBe(true);
mxClient.WrittenValues.ShouldContain(w => w.Tag == "TestMachine_001.MachineCode" && (string)w.Value == "NEW_CODE");
mxClient.WrittenValues.ShouldContain(w =>
w.Tag == "TestMachine_001.MachineCode" && (string)w.Value == "NEW_CODE");
}
}
}
}

View File

@@ -10,12 +10,12 @@ using ZB.MOM.WW.LmxOpcUa.Tests.Helpers;
namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
{
/// <summary>
/// Verifies: OpcUaService Start() creates and wires all components with fakes.
/// Verifies: OpcUaService Start() creates and wires all components with fakes.
/// </summary>
public class ServiceStartupSequenceTest
{
/// <summary>
/// Confirms that startup with fake dependencies creates the expected bridge components and state.
/// Confirms that startup with fake dependencies creates the expected bridge components and state.
/// </summary>
[Fact]
public void Start_WithFakes_AllComponentsCreated()
@@ -38,11 +38,18 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
{
Hierarchy = new List<GalaxyObjectInfo>
{
new GalaxyObjectInfo { GobjectId = 1, TagName = "TestObj", BrowseName = "TestObj", ParentGobjectId = 0, IsArea = false }
new()
{
GobjectId = 1, TagName = "TestObj", BrowseName = "TestObj", ParentGobjectId = 0, IsArea = false
}
},
Attributes = new List<GalaxyAttributeInfo>
{
new GalaxyAttributeInfo { GobjectId = 1, TagName = "TestObj", AttributeName = "TestAttr", FullTagReference = "TestObj.TestAttr", MxDataType = 5, IsArray = false }
new()
{
GobjectId = 1, TagName = "TestObj", AttributeName = "TestAttr",
FullTagReference = "TestObj.TestAttr", MxDataType = 5, IsArray = false
}
}
};
@@ -75,7 +82,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
}
/// <summary>
/// Confirms that when MXAccess is initially unavailable, the background monitor reconnects it later.
/// Confirms that when MXAccess is initially unavailable, the background monitor reconnects it later.
/// </summary>
[Fact]
public async Task Start_WhenMxAccessIsInitiallyDown_MonitorReconnectsInBackground()
@@ -103,11 +110,18 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
{
Hierarchy = new List<GalaxyObjectInfo>
{
new GalaxyObjectInfo { GobjectId = 1, TagName = "TestObj", BrowseName = "TestObj", ParentGobjectId = 0, IsArea = false }
new()
{
GobjectId = 1, TagName = "TestObj", BrowseName = "TestObj", ParentGobjectId = 0, IsArea = false
}
},
Attributes = new List<GalaxyAttributeInfo>
{
new GalaxyAttributeInfo { GobjectId = 1, TagName = "TestObj", AttributeName = "TestAttr", FullTagReference = "TestObj.TestAttr", MxDataType = 5, IsArray = false }
new()
{
GobjectId = 1, TagName = "TestObj", AttributeName = "TestAttr",
FullTagReference = "TestObj.TestAttr", MxDataType = 5, IsArray = false
}
}
};
@@ -132,4 +146,4 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
}
}
}
}
}

View File

@@ -1,22 +1,19 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Shouldly;
using Xunit;
using ZB.MOM.WW.LmxOpcUa.Host;
using ZB.MOM.WW.LmxOpcUa.Host.Configuration;
using ZB.MOM.WW.LmxOpcUa.Host.Domain;
using ZB.MOM.WW.LmxOpcUa.Tests.Helpers;
namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
{
/// <summary>
/// Verifies: Start then Stop completes within 30 seconds. (SVC-004)
/// Verifies: Start then Stop completes within 30 seconds. (SVC-004)
/// </summary>
public class ShutdownCompletesTest
{
/// <summary>
/// Confirms that a started service can shut down within the required time budget.
/// Confirms that a started service can shut down within the required time budget.
/// </summary>
[Fact]
public void Shutdown_CompletesWithin30Seconds()
@@ -41,4 +38,4 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Wiring
sw.Elapsed.TotalSeconds.ShouldBeLessThan(30);
}
}
}
}