test: remaining xUnit1051/1031/1030, CS8602/8604, CS0618, CS0219, CS0649, NU1510 fixes (lmxopcua#725)
v2-ci / unit-tests (push) Has been cancelled

Awaited deadline oracles get the runner token; sync-over-async tests made async;
nullable child models asserted via ShouldNotBeNull() return values; obsolete SDK
ctors replaced with the telemetry overloads; dead locals/fixture and the redundant
DI PackageReference removed. No suppressions.

Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
Joseph Doherty
2026-11-09 13:22:34 -05:00
parent 1d7a4b7a53
commit b8202e1147
27 changed files with 84 additions and 92 deletions
@@ -15,7 +15,7 @@ public class DefaultSubscriptionAdapterTests
[Fact]
public async Task DeleteAsync_detaches_the_subscription_from_its_session_once()
{
var subscription = new Subscription();
var subscription = new Subscription(ClientTelemetry.Context);
var detached = new List<Subscription>();
var adapter = new DefaultSubscriptionAdapter(subscription, (s, _) =>
{
@@ -34,7 +34,7 @@ public class DefaultSubscriptionAdapterTests
public void Dispose_detaches_the_subscription_from_its_session()
{
var detached = 0;
var adapter = new DefaultSubscriptionAdapter(new Subscription(), (_, _) =>
var adapter = new DefaultSubscriptionAdapter(new Subscription(ClientTelemetry.Context), (_, _) =>
{
Interlocked.Increment(ref detached);
return Task.CompletedTask;
@@ -49,7 +49,7 @@ public class DefaultSubscriptionAdapterTests
[Fact]
public async Task A_failing_detach_does_not_throw_from_DeleteAsync()
{
var adapter = new DefaultSubscriptionAdapter(new Subscription(),
var adapter = new DefaultSubscriptionAdapter(new Subscription(ClientTelemetry.Context),
(_, _) => throw new InvalidOperationException("boom"));
await Should.NotThrowAsync(() => adapter.DeleteAsync(TestContext.Current.CancellationToken));
@@ -860,7 +860,6 @@ public class OpcUaClientServiceTests : IDisposable
[Fact]
public async Task GetRedundancyInfoAsync_MissingOptionalArrays_ReturnsGracefully()
{
var readCallIndex = 0;
var session = new FakeSessionAdapter
{
ReadResponseFunc = nodeId =>
@@ -1554,7 +1553,7 @@ public class OpcUaClientServiceTests : IDisposable
{
await _service.SubscribeAsync(nodeId);
await _service.UnsubscribeAsync(nodeId);
}));
}, TestContext.Current.CancellationToken));
}
// No InvalidOperationException from concurrent Dictionary mutation.
@@ -1634,7 +1633,6 @@ public class OpcUaClientServiceTests : IDisposable
var alarmFakeSub = new FakeSubscriptionAdapter();
// First CreateSubscription call → data subscription; second → alarm subscription.
var callIndex = 0;
var session = new FakeSessionAdapter
{
NextSubscription = dataFakeSub