diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 0732e7f8..800e41fc 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -10,7 +10,7 @@ "rollForward": false }, "jetbrains.resharper.globaltools": { - "version": "2026.2.0.1", + "version": "2026.2.0.2", "commands": [ "jb" ], diff --git a/Directory.Packages.props b/Directory.Packages.props index 121b49f3..6dcae220 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -15,21 +15,21 @@ - - + + - - + + - + @@ -37,15 +37,15 @@ - + - - + + diff --git a/tests/RustPlusBot.Features.Alarms.Tests/AlarmStateRelayTests.cs b/tests/RustPlusBot.Features.Alarms.Tests/AlarmStateRelayTests.cs index f91897e9..f3a1c249 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 ecff6952..1e1aaf00 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 26783a2e..e7d6e3d2 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 7e8c5c55..518e5aa4 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 eae4b18e..096633ec 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 194daa25..1a881378 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 27814311..047ef55e 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,7 @@ 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.Is(e => e.ServerId == server.Id && e.EntityId == 55UL), Arg.Any()); await bus.DidNotReceive().PublishAsync(Arg.Any(), Arg.Any()); } @@ -178,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 93c7155a..c181514e 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 1c5b2a7b..a712d3b4 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 d68a91f9..f46a8b40 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/StorageMonitorStateRelayTests.cs b/tests/RustPlusBot.Features.StorageMonitors.Tests/StorageMonitorStateRelayTests.cs index 3c1180fa..c262472c 100644 --- a/tests/RustPlusBot.Features.StorageMonitors.Tests/StorageMonitorStateRelayTests.cs +++ b/tests/RustPlusBot.Features.StorageMonitors.Tests/StorageMonitorStateRelayTests.cs @@ -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 10bf8d6a..0394e4c9 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(e => e!.Title == "🧹 Server wiped"), + Arg.Is(e => e.Title == "🧹 Server wiped"), Arg.Any()); } @@ -93,7 +93,7 @@ public async Task Renders_with_guild_culture() await h.Poster.Received(1).PostAsync( 777UL, null, - Arg.Is(e => e!.Title == "🧹 Serveur wipé"), + Arg.Is(e => e.Title == "🧹 Serveur wipé"), Arg.Any()); }