diff --git a/Directory.Packages.props b/Directory.Packages.props
index 07efecbd..e59138a0 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -37,7 +37,7 @@
-
+
diff --git a/tests/RustPlusBot.Features.Alarms.Tests/AlarmStateRelayTests.cs b/tests/RustPlusBot.Features.Alarms.Tests/AlarmStateRelayTests.cs
index 5e8fcfff..be95e875 100644
--- a/tests/RustPlusBot.Features.Alarms.Tests/AlarmStateRelayTests.cs
+++ b/tests/RustPlusBot.Features.Alarms.Tests/AlarmStateRelayTests.cs
@@ -373,9 +373,9 @@ await h.Relay.HandleConnectionStatusAsync(
CancellationToken.None);
await h.Refresher.Received(1).RefreshAsync(
- Arg.Is(a => a.EntityId == 42UL), unreachable: true, Arg.Any());
+ Arg.Is(a => a!.EntityId == 42UL), unreachable: true, Arg.Any());
await h.Refresher.Received(1).RefreshAsync(
- Arg.Is(a => a.EntityId == 43UL), unreachable: true, Arg.Any());
+ Arg.Is(a => a!.EntityId == 43UL), unreachable: true, Arg.Any());
}
/// Connected server → no-op (supervisor's prime path handles it).
diff --git a/tests/RustPlusBot.Features.Alarms.Tests/Hosting/AlarmsHostedServiceTests.cs b/tests/RustPlusBot.Features.Alarms.Tests/Hosting/AlarmsHostedServiceTests.cs
index d893fe6b..01ec0c0a 100644
--- a/tests/RustPlusBot.Features.Alarms.Tests/Hosting/AlarmsHostedServiceTests.cs
+++ b/tests/RustPlusBot.Features.Alarms.Tests/Hosting/AlarmsHostedServiceTests.cs
@@ -198,7 +198,7 @@ await h.Bus.PublishAsync(
}
await h.Refresher.Received().RefreshAsync(
- Arg.Is(a => a.EntityId == 42UL), unreachable: true, Arg.Any());
+ Arg.Is(a => a!.EntityId == 42UL), unreachable: true, Arg.Any());
await h.Service.StopAsync(default);
}
diff --git a/tests/RustPlusBot.Features.Events.Tests/Hosting/EventsHostedServiceTickTests.cs b/tests/RustPlusBot.Features.Events.Tests/Hosting/EventsHostedServiceTickTests.cs
index e7d6e3d2..26783a2e 100644
--- a/tests/RustPlusBot.Features.Events.Tests/Hosting/EventsHostedServiceTickTests.cs
+++ b/tests/RustPlusBot.Features.Events.Tests/Hosting/EventsHostedServiceTickTests.cs
@@ -28,7 +28,7 @@ public async Task TickOnce_publishes_a_crate_lootable_event_when_active_window_e
await service.TickOnceAsync(CancellationToken.None);
await bus.Received(1).PublishAsync(
- Arg.Is(e => e.Kind == RigEventKind.CrateLootable && e.Rig == RigKind.Small),
+ Arg.Is(e => e!.Kind == RigEventKind.CrateLootable && e.Rig == RigKind.Small),
Arg.Any());
}
diff --git a/tests/RustPlusBot.Features.Map.Tests/RustMaps/RustMapsGenerationDriverTests.cs b/tests/RustPlusBot.Features.Map.Tests/RustMaps/RustMapsGenerationDriverTests.cs
index 518e5aa4..7e8c5c55 100644
--- a/tests/RustPlusBot.Features.Map.Tests/RustMaps/RustMapsGenerationDriverTests.cs
+++ b/tests/RustPlusBot.Features.Map.Tests/RustMaps/RustMapsGenerationDriverTests.cs
@@ -87,7 +87,7 @@ public async Task NotFound_with_budget_generates_exactly_once_across_ticks()
Assert.Equal(RustMapsGenerationState.Generating, coord.Snapshot(Key).State);
await client.Received(1).CreateMapAsync(
- Arg.Is(r => r.Size == 4000 && r.Seed == 12345 && !r.Staging),
+ Arg.Is(r => r!.Size == 4000 && r.Seed == 12345 && !r.Staging),
Arg.Any());
}
diff --git a/tests/RustPlusBot.Features.Pairing.Tests/AccountDisconnectServiceTests.cs b/tests/RustPlusBot.Features.Pairing.Tests/AccountDisconnectServiceTests.cs
index 096633ec..eae4b18e 100644
--- a/tests/RustPlusBot.Features.Pairing.Tests/AccountDisconnectServiceTests.cs
+++ b/tests/RustPlusBot.Features.Pairing.Tests/AccountDisconnectServiceTests.cs
@@ -49,10 +49,10 @@ public async Task Disconnect_StopsListener_DisablesRegistration_RemovesCreds_Pub
await sup.Received(1).StopListenerAsync(10UL, 99UL);
await regs.Received(1).SetStatusAsync(regId, FcmRegistrationStatus.Disabled, Arg.Any());
await bus.Received(1).PublishAsync(
- Arg.Is(e => e.GuildId == 10UL && e.ServerId == s1),
+ Arg.Is(e => e!.GuildId == 10UL && e.ServerId == s1),
Arg.Any());
await bus.Received(1).PublishAsync(
- Arg.Is(e => e.ServerId == s2), Arg.Any());
+ Arg.Is(e => e!.ServerId == s2), Arg.Any());
}
[Fact]
diff --git a/tests/RustPlusBot.Features.Pairing.Tests/DiscordOwnerNotifierTests.cs b/tests/RustPlusBot.Features.Pairing.Tests/DiscordOwnerNotifierTests.cs
index 1a881378..194daa25 100644
--- a/tests/RustPlusBot.Features.Pairing.Tests/DiscordOwnerNotifierTests.cs
+++ b/tests/RustPlusBot.Features.Pairing.Tests/DiscordOwnerNotifierTests.cs
@@ -16,7 +16,7 @@ public async Task NotifyCredentialsExpired_DmsTheOwner()
await dm.Received(1).SendAsync(
99UL,
- Arg.Is(m => m.Contains("Reconnect", StringComparison.Ordinal)),
+ Arg.Is(m => m!.Contains("Reconnect", StringComparison.Ordinal)),
Arg.Any());
}
@@ -29,6 +29,6 @@ public async Task NotifySetupChannelMissing_dms_owner_with_setup_instructions()
await notifier.NotifySetupChannelMissingAsync(10UL, 99UL, CancellationToken.None);
await dm.Received(1).SendAsync(99UL,
- Arg.Is(m => m.Contains("/setup", StringComparison.Ordinal)), Arg.Any());
+ Arg.Is(m => m!.Contains("/setup", StringComparison.Ordinal)), Arg.Any());
}
}
diff --git a/tests/RustPlusBot.Features.Pairing.Tests/PairingHandlerTests.cs b/tests/RustPlusBot.Features.Pairing.Tests/PairingHandlerTests.cs
index 4a893949..27814311 100644
--- a/tests/RustPlusBot.Features.Pairing.Tests/PairingHandlerTests.cs
+++ b/tests/RustPlusBot.Features.Pairing.Tests/PairingHandlerTests.cs
@@ -73,7 +73,7 @@ public async Task NewServerPairing_RoutesToCoordinator_PersistsNothing()
await handler.HandleAsync(10UL, 99UL, ServerPairing(), CancellationToken.None);
await coordinator.Received(1).HandleDetectedAsync(10UL, 99UL,
- Arg.Is(n => n.Ip == "1.2.3.4" && n.Port == 28015), Arg.Any());
+ Arg.Is(n => n!.Ip == "1.2.3.4" && n.Port == 28015), Arg.Any());
Assert.Empty(await context.RustServers.ToListAsync());
Assert.Empty(await context.PlayerCredentials.ToListAsync());
await bus.DidNotReceive().PublishAsync(Arg.Any(), Arg.Any());
@@ -128,7 +128,7 @@ public async Task EntityPairing_KnownServer_PublishesSwitchPairedEvent()
await handler.HandleAsync(10UL, 1UL, EntityPairing(FpServer, entityId: 42UL), CancellationToken.None);
await bus.Received(1).PublishAsync(
- Arg.Is(e => e.GuildId == 10UL && e.ServerId == server.Id && e.EntityId == 42UL),
+ Arg.Is(e => e!.GuildId == 10UL && e.ServerId == server.Id && e.EntityId == 42UL),
Arg.Any());
}
@@ -160,7 +160,8 @@ public async Task EntityPairing_Alarm_PublishesAlarmPairedEvent_NotSwitch()
await handler.HandleAsync(10UL, 1UL, AlarmPairing(FpServer, 55UL), CancellationToken.None);
await bus.Received(1).PublishAsync(
- Arg.Is(e => e.ServerId == server.Id && e.EntityId == 55UL), Arg.Any());
+ Arg.Is(e => e!.ServerId == server.Id && e.EntityId == 55UL),
+ Arg.Any());
await bus.DidNotReceive().PublishAsync(Arg.Any(), Arg.Any());
}
@@ -177,7 +178,7 @@ public async Task EntityPairing_StorageMonitor_PublishesStorageMonitorPairedEven
await handler.HandleAsync(10UL, 1UL, StorageMonitorPairing(FpServer, 77UL), CancellationToken.None);
await bus.Received(1).PublishAsync(
- Arg.Is(e => e.ServerId == server.Id && e.EntityId == 77UL),
+ Arg.Is(e => e!.ServerId == server.Id && e.EntityId == 77UL),
Arg.Any());
await bus.DidNotReceive().PublishAsync(Arg.Any(), Arg.Any());
}
diff --git a/tests/RustPlusBot.Features.Pairing.Tests/ServerPairingCoordinatorTests.cs b/tests/RustPlusBot.Features.Pairing.Tests/ServerPairingCoordinatorTests.cs
index c181514e..93c7155a 100644
--- a/tests/RustPlusBot.Features.Pairing.Tests/ServerPairingCoordinatorTests.cs
+++ b/tests/RustPlusBot.Features.Pairing.Tests/ServerPairingCoordinatorTests.cs
@@ -167,7 +167,7 @@ public async Task Accept_persists_publishes_event_once_and_edits_prompt()
Assert.Equal(server.Id, credential.RustServerId);
Assert.Equal(CredentialStatus.Active, credential.Status);
await h.Bus.Received(1).PublishAsync(
- Arg.Is(e => e.GuildId == 10UL && e.ServerId == server.Id),
+ Arg.Is(e => e!.GuildId == 10UL && e.ServerId == server.Id),
Arg.Any());
await h.Poster.Received(1).EnsureAsync(777UL, 900UL, Arg.Any(),
Arg.Any(), Arg.Any());
@@ -279,7 +279,7 @@ public async Task Accept_without_setup_channel_still_persists_and_skips_edit()
Assert.Equal(server.Id, credential.RustServerId);
Assert.Equal(CredentialStatus.Active, credential.Status);
await h.Bus.Received(1).PublishAsync(
- Arg.Is(e => e.GuildId == 10UL && e.ServerId == server.Id),
+ Arg.Is(e => e!.GuildId == 10UL && e.ServerId == server.Id),
Arg.Any());
await h.Poster.Received(1).EnsureAsync(Arg.Any(), Arg.Any(),
Arg.Any(), Arg.Any(),
diff --git a/tests/RustPlusBot.Features.Players.Tests/Hosting/PlayersHostedServiceTests.cs b/tests/RustPlusBot.Features.Players.Tests/Hosting/PlayersHostedServiceTests.cs
index f4248473..ccab54c7 100644
--- a/tests/RustPlusBot.Features.Players.Tests/Hosting/PlayersHostedServiceTests.cs
+++ b/tests/RustPlusBot.Features.Players.Tests/Hosting/PlayersHostedServiceTests.cs
@@ -72,7 +72,7 @@ await h.Bus.PublishAsync(new PlayerStateChangedEvent(
}
await h.Sender.Received().SendAsync(
- 10UL, serverId, Arg.Is(s => s.Contains("Alice")), Arg.Any());
+ 10UL, serverId, Arg.Is(s => s!.Contains("Alice")), Arg.Any());
await h.Service.StopAsync(default);
}
@@ -114,7 +114,7 @@ await h.Bus.PublishAsync(new PlayerStateChangedEvent(
// The relay threw, causing the loop to fault and complete (LogRelayLoopFaulted). StopAsync joins the
// faulted task cleanly — no rethrow. This is crash-isolation, not per-event resilience.
await h.Sender.Received().SendAsync(
- 10UL, Arg.Any(), Arg.Is(s => s.Contains("Bob")), Arg.Any());
+ 10UL, Arg.Any(), Arg.Is(s => s!.Contains("Bob")), Arg.Any());
await h.Service.StopAsync(default);
}
diff --git a/tests/RustPlusBot.Features.Players.Tests/PlayerEventRelayTests.cs b/tests/RustPlusBot.Features.Players.Tests/PlayerEventRelayTests.cs
index 478529f2..c830811c 100644
--- a/tests/RustPlusBot.Features.Players.Tests/PlayerEventRelayTests.cs
+++ b/tests/RustPlusBot.Features.Players.Tests/PlayerEventRelayTests.cs
@@ -54,7 +54,7 @@ await relay.RelayAsync(
Evt(new PlayerTransition(PlayerTransitionKind.Connect, 1, "Bob", null)), CancellationToken.None);
await _sender.Received(1).SendAsync(
- Arg.Any(), Arg.Any(), Arg.Is(s => s.Contains("Bob")), Arg.Any());
+ Arg.Any(), Arg.Any(), Arg.Is(s => s!.Contains("Bob")), Arg.Any());
}
[Fact]
diff --git a/tests/RustPlusBot.Features.StorageMonitors.Tests/Hosting/StorageMonitorsHostedServiceTests.cs b/tests/RustPlusBot.Features.StorageMonitors.Tests/Hosting/StorageMonitorsHostedServiceTests.cs
index d33fab26..8fbe65de 100644
--- a/tests/RustPlusBot.Features.StorageMonitors.Tests/Hosting/StorageMonitorsHostedServiceTests.cs
+++ b/tests/RustPlusBot.Features.StorageMonitors.Tests/Hosting/StorageMonitorsHostedServiceTests.cs
@@ -41,7 +41,7 @@ private static Harness Create()
relayPoster.EnsureAsync(Arg.Any(), Arg.Any(), Arg.Any(),
Arg.Any(), Arg.Any()).Returns((ulong?)900UL);
var names = Substitute.For();
- names.Resolve(Arg.Any()).Returns(ci => "Item" + (int)ci[0]);
+ names.Resolve(Arg.Any()).Returns(ci => "Item" + (int)ci[0]!);
var renderer = new StorageMonitorEmbedRenderer(new ResxLocalizer(), names);
var relay = new StorageMonitorStateRelay(scopeFactory, relayLocator, relayPoster, renderer,
Substitute.For());
diff --git a/tests/RustPlusBot.Features.StorageMonitors.Tests/StorageMonitorEmbedRendererTests.cs b/tests/RustPlusBot.Features.StorageMonitors.Tests/StorageMonitorEmbedRendererTests.cs
index a0057ff2..137d90d1 100644
--- a/tests/RustPlusBot.Features.StorageMonitors.Tests/StorageMonitorEmbedRendererTests.cs
+++ b/tests/RustPlusBot.Features.StorageMonitors.Tests/StorageMonitorEmbedRendererTests.cs
@@ -14,7 +14,7 @@ private static StorageMonitorEmbedRenderer Create(out IItemNameResolver names)
{
var loc = new ResxLocalizer();
names = Substitute.For();
- names.Resolve(Arg.Any()).Returns(ci => "Item" + (int)ci[0]);
+ names.Resolve(Arg.Any()).Returns(ci => "Item" + (int)ci[0]!);
return new StorageMonitorEmbedRenderer(loc, names);
}
diff --git a/tests/RustPlusBot.Features.StorageMonitors.Tests/StorageMonitorPairingCoordinatorTests.cs b/tests/RustPlusBot.Features.StorageMonitors.Tests/StorageMonitorPairingCoordinatorTests.cs
index 191157ef..47a9ecc5 100644
--- a/tests/RustPlusBot.Features.StorageMonitors.Tests/StorageMonitorPairingCoordinatorTests.cs
+++ b/tests/RustPlusBot.Features.StorageMonitors.Tests/StorageMonitorPairingCoordinatorTests.cs
@@ -37,7 +37,7 @@ private static Harness Create()
.Returns(900UL);
var names = Substitute.For();
- names.Resolve(Arg.Any()).Returns(ci => "Item" + (int)ci[0]);
+ names.Resolve(Arg.Any()).Returns(ci => "Item" + (int)ci[0]!);
var renderer = new StorageMonitorEmbedRenderer(new ResxLocalizer(), names);
var coordinator = new StorageMonitorPairingCoordinator(scopeFactory, locator, poster, renderer);
return new Harness(coordinator, store, poster, locator);
diff --git a/tests/RustPlusBot.Features.StorageMonitors.Tests/StorageMonitorStateRelayTests.cs b/tests/RustPlusBot.Features.StorageMonitors.Tests/StorageMonitorStateRelayTests.cs
index c254f68a..3c1180fa 100644
--- a/tests/RustPlusBot.Features.StorageMonitors.Tests/StorageMonitorStateRelayTests.cs
+++ b/tests/RustPlusBot.Features.StorageMonitors.Tests/StorageMonitorStateRelayTests.cs
@@ -38,7 +38,7 @@ private static Harness Create()
Arg.Any(), Arg.Any()).Returns((ulong?)900UL);
var names = Substitute.For();
- names.Resolve(Arg.Any()).Returns(ci => "Item" + (int)ci[0]);
+ names.Resolve(Arg.Any()).Returns(ci => "Item" + (int)ci[0]!);
var renderer = new StorageMonitorEmbedRenderer(new ResxLocalizer(), names);
var query = Substitute.For();
@@ -222,7 +222,7 @@ await h.Relay.HandleReachabilityChangedAsync(
// A device that became reachable must show its live contents, not the unreachable banner
// (a null-contents render here would also disable the Refresh/Rename buttons).
await h.Poster.Received(1).EnsureAsync(555UL, 900UL,
- Arg.Is(e => e.Description.Contains("Item100")),
+ Arg.Is(e => e!.Description.Contains("Item100")),
Arg.Any(), Arg.Any());
}
diff --git a/tests/RustPlusBot.Features.Wipes.Tests/WipeAnnouncerTests.cs b/tests/RustPlusBot.Features.Wipes.Tests/WipeAnnouncerTests.cs
index 0394e4c9..10bf8d6a 100644
--- a/tests/RustPlusBot.Features.Wipes.Tests/WipeAnnouncerTests.cs
+++ b/tests/RustPlusBot.Features.Wipes.Tests/WipeAnnouncerTests.cs
@@ -65,7 +65,7 @@ public async Task Posts_embed_without_ping_by_default()
await h.Poster.Received(1).PostAsync(
777UL,
null,
- Arg.Is