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

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Shouldly;
@@ -13,17 +12,17 @@ using ZB.MOM.WW.LmxOpcUa.Tests.Helpers;
namespace ZB.MOM.WW.LmxOpcUa.Tests.MxAccess
{
/// <summary>
/// Verifies how the MXAccess client manages persistent subscriptions, reconnect replay, and probe-tag behavior.
/// Verifies how the MXAccess client manages persistent subscriptions, reconnect replay, and probe-tag behavior.
/// </summary>
public class MxAccessClientSubscriptionTests : IDisposable
{
private readonly StaComThread _staThread;
private readonly FakeMxProxy _proxy;
private readonly PerformanceMetrics _metrics;
private readonly MxAccessClient _client;
private readonly PerformanceMetrics _metrics;
private readonly FakeMxProxy _proxy;
private readonly StaComThread _staThread;
/// <summary>
/// Initializes the subscription test fixture with a fake runtime proxy and STA thread.
/// Initializes the subscription test fixture with a fake runtime proxy and STA thread.
/// </summary>
public MxAccessClientSubscriptionTests()
{
@@ -35,7 +34,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.MxAccess
}
/// <summary>
/// Disposes the subscription test fixture and its supporting resources.
/// Disposes the subscription test fixture and its supporting resources.
/// </summary>
public void Dispose()
{
@@ -45,7 +44,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.MxAccess
}
/// <summary>
/// Confirms that subscribing creates a runtime item, advises it, and increments the active subscription count.
/// Confirms that subscribing creates a runtime item, advises it, and increments the active subscription count.
/// </summary>
[Fact]
public async Task Subscribe_CreatesItemAndAdvises()
@@ -59,7 +58,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.MxAccess
}
/// <summary>
/// Confirms that subscribing to the same address twice reuses the existing runtime item.
/// Confirms that subscribing to the same address twice reuses the existing runtime item.
/// </summary>
[Fact]
public async Task Subscribe_SameAddressTwice_ReusesExistingRuntimeItem()
@@ -78,7 +77,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.MxAccess
}
/// <summary>
/// Confirms that unsubscribing clears the active subscription count after a tag was previously monitored.
/// Confirms that unsubscribing clears the active subscription count after a tag was previously monitored.
/// </summary>
[Fact]
public async Task Unsubscribe_RemovesItemAndUnadvises()
@@ -91,7 +90,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.MxAccess
}
/// <summary>
/// Confirms that runtime data changes are delivered to the per-subscription callback.
/// Confirms that runtime data changes are delivered to the per-subscription callback.
/// </summary>
[Fact]
public async Task OnDataChange_InvokesCallback()
@@ -101,7 +100,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.MxAccess
Vtq? received = null;
await _client.SubscribeAsync("TestTag.Attr", (addr, vtq) => received = vtq);
_proxy.SimulateDataChangeByAddress("TestTag.Attr", 42, 192);
_proxy.SimulateDataChangeByAddress("TestTag.Attr", 42);
received.ShouldNotBeNull();
received.Value.Value.ShouldBe(42);
@@ -109,7 +108,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.MxAccess
}
/// <summary>
/// Confirms that runtime data changes are also delivered to the client's global tag-change event.
/// Confirms that runtime data changes are also delivered to the client's global tag-change event.
/// </summary>
[Fact]
public async Task OnDataChange_InvokesGlobalHandler()
@@ -120,13 +119,13 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.MxAccess
_client.OnTagValueChanged += (addr, vtq) => globalAddr = addr;
await _client.SubscribeAsync("TestTag.Attr", (_, _) => { });
_proxy.SimulateDataChangeByAddress("TestTag.Attr", "hello", 192);
_proxy.SimulateDataChangeByAddress("TestTag.Attr", "hello");
globalAddr.ShouldBe("TestTag.Attr");
}
/// <summary>
/// Confirms that stored subscriptions are replayed after reconnect so live updates resume automatically.
/// Confirms that stored subscriptions are replayed after reconnect so live updates resume automatically.
/// </summary>
[Fact]
public async Task StoredSubscriptions_ReplayedAfterReconnect()
@@ -142,12 +141,12 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.MxAccess
_client.ActiveSubscriptionCount.ShouldBe(1);
// Simulate data change on the re-subscribed item
_proxy.SimulateDataChangeByAddress("TestTag.Attr", "value", 192);
_proxy.SimulateDataChangeByAddress("TestTag.Attr", "value");
callbackInvoked.ShouldBe(true);
}
/// <summary>
/// Confirms that one-shot reads do not remove persistent subscriptions when the client reconnects.
/// Confirms that one-shot reads do not remove persistent subscriptions when the client reconnects.
/// </summary>
[Fact]
public async Task OneShotRead_DoesNotRemovePersistentSubscription_OnReconnect()
@@ -158,19 +157,19 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.MxAccess
var readTask = _client.ReadAsync("TestTag.Attr");
await Task.Delay(50);
_proxy.SimulateDataChangeByAddress("TestTag.Attr", 42, 192);
_proxy.SimulateDataChangeByAddress("TestTag.Attr", 42);
(await readTask).Value.ShouldBe(42);
callbackInvoked = false;
await _client.ReconnectAsync();
_proxy.SimulateDataChangeByAddress("TestTag.Attr", "after_reconnect", 192);
_proxy.SimulateDataChangeByAddress("TestTag.Attr", "after_reconnect");
callbackInvoked.ShouldBe(true);
_client.ActiveSubscriptionCount.ShouldBe(1);
}
/// <summary>
/// Confirms that transient writes do not prevent later removal of a persistent subscription.
/// Confirms that transient writes do not prevent later removal of a persistent subscription.
/// </summary>
[Fact]
public async Task OneShotWrite_DoesNotBreakPersistentUnsubscribe()
@@ -189,7 +188,8 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.MxAccess
}
/// <summary>
/// Confirms that the configured probe tag is subscribed during connect so connectivity monitoring can start immediately.
/// Confirms that the configured probe tag is subscribed during connect so connectivity monitoring can start
/// immediately.
/// </summary>
[Fact]
public async Task ProbeTag_SubscribedOnConnect()
@@ -206,7 +206,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.MxAccess
}
/// <summary>
/// Confirms that the probe tag cannot be unsubscribed accidentally because it is reserved for connection monitoring.
/// Confirms that the probe tag cannot be unsubscribed accidentally because it is reserved for connection monitoring.
/// </summary>
[Fact]
public async Task ProbeTag_ProtectedFromUnsubscribe()
@@ -226,4 +226,4 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.MxAccess
client.Dispose();
}
}
}
}