Skip to content

Commit 2d11ac1

Browse files
dependabot[bot]HandyS11claude
authored
Bump NSubstitute from 5.3.0 to 6.0.0 (#49)
* Bump NSubstitute from 5.3.0 to 6.0.0 --- updated-dependencies: - dependency-name: NSubstitute dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Fix nullable errors from NSubstitute 6 in test matchers NSubstitute 6 annotates Arg.Is<T> predicate parameters and CallInfo's indexer as nullable, so existing matcher lambdas tripped CS8602/CS8605 (treated as errors). Add null-forgiving operators at the first dereference in each affected matcher. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: = <valentin-clergue@orange.fr> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 54263a4 commit 2d11ac1

16 files changed

Lines changed: 27 additions & 26 deletions

File tree

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<PackageVersion Include="coverlet.collector" Version="10.0.1" />
3838
<PackageVersion Include="xunit" Version="2.9.3" />
3939
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
40-
<PackageVersion Include="NSubstitute" Version="5.3.0" />
40+
<PackageVersion Include="NSubstitute" Version="6.0.0" />
4141
<PackageVersion Include="Xunit.SkippableFact" Version="1.5.61" />
4242
</ItemGroup>
4343
<ItemGroup>

tests/RustPlusBot.Features.Alarms.Tests/AlarmStateRelayTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,9 @@ await h.Relay.HandleConnectionStatusAsync(
373373
CancellationToken.None);
374374

375375
await h.Refresher.Received(1).RefreshAsync(
376-
Arg.Is<SmartAlarm>(a => a.EntityId == 42UL), unreachable: true, Arg.Any<CancellationToken>());
376+
Arg.Is<SmartAlarm>(a => a!.EntityId == 42UL), unreachable: true, Arg.Any<CancellationToken>());
377377
await h.Refresher.Received(1).RefreshAsync(
378-
Arg.Is<SmartAlarm>(a => a.EntityId == 43UL), unreachable: true, Arg.Any<CancellationToken>());
378+
Arg.Is<SmartAlarm>(a => a!.EntityId == 43UL), unreachable: true, Arg.Any<CancellationToken>());
379379
}
380380

381381
/// <summary>Connected server → no-op (supervisor's prime path handles it).</summary>

tests/RustPlusBot.Features.Alarms.Tests/Hosting/AlarmsHostedServiceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ await h.Bus.PublishAsync(
198198
}
199199

200200
await h.Refresher.Received().RefreshAsync(
201-
Arg.Is<SmartAlarm>(a => a.EntityId == 42UL), unreachable: true, Arg.Any<CancellationToken>());
201+
Arg.Is<SmartAlarm>(a => a!.EntityId == 42UL), unreachable: true, Arg.Any<CancellationToken>());
202202

203203
await h.Service.StopAsync(default);
204204
}

tests/RustPlusBot.Features.Events.Tests/Hosting/EventsHostedServiceTickTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public async Task TickOnce_publishes_a_crate_lootable_event_when_active_window_e
2828
await service.TickOnceAsync(CancellationToken.None);
2929

3030
await bus.Received(1).PublishAsync(
31-
Arg.Is<RigStateChangedEvent>(e => e.Kind == RigEventKind.CrateLootable && e.Rig == RigKind.Small),
31+
Arg.Is<RigStateChangedEvent>(e => e!.Kind == RigEventKind.CrateLootable && e.Rig == RigKind.Small),
3232
Arg.Any<CancellationToken>());
3333
}
3434

tests/RustPlusBot.Features.Map.Tests/RustMaps/RustMapsGenerationDriverTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public async Task NotFound_with_budget_generates_exactly_once_across_ticks()
8787

8888
Assert.Equal(RustMapsGenerationState.Generating, coord.Snapshot(Key).State);
8989
await client.Received(1).CreateMapAsync(
90-
Arg.Is<MapGenerationRequest>(r => r.Size == 4000 && r.Seed == 12345 && !r.Staging),
90+
Arg.Is<MapGenerationRequest>(r => r!.Size == 4000 && r.Seed == 12345 && !r.Staging),
9191
Arg.Any<CancellationToken>());
9292
}
9393

tests/RustPlusBot.Features.Pairing.Tests/AccountDisconnectServiceTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ public async Task Disconnect_StopsListener_DisablesRegistration_RemovesCreds_Pub
4949
await sup.Received(1).StopListenerAsync(10UL, 99UL);
5050
await regs.Received(1).SetStatusAsync(regId, FcmRegistrationStatus.Disabled, Arg.Any<CancellationToken>());
5151
await bus.Received(1).PublishAsync(
52-
Arg.Is<ServerCredentialsChangedEvent>(e => e.GuildId == 10UL && e.ServerId == s1),
52+
Arg.Is<ServerCredentialsChangedEvent>(e => e!.GuildId == 10UL && e.ServerId == s1),
5353
Arg.Any<CancellationToken>());
5454
await bus.Received(1).PublishAsync(
55-
Arg.Is<ServerCredentialsChangedEvent>(e => e.ServerId == s2), Arg.Any<CancellationToken>());
55+
Arg.Is<ServerCredentialsChangedEvent>(e => e!.ServerId == s2), Arg.Any<CancellationToken>());
5656
}
5757

5858
[Fact]

tests/RustPlusBot.Features.Pairing.Tests/DiscordOwnerNotifierTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public async Task NotifyCredentialsExpired_DmsTheOwner()
1616

1717
await dm.Received(1).SendAsync(
1818
99UL,
19-
Arg.Is<string>(m => m.Contains("Reconnect", StringComparison.Ordinal)),
19+
Arg.Is<string>(m => m!.Contains("Reconnect", StringComparison.Ordinal)),
2020
Arg.Any<CancellationToken>());
2121
}
2222

@@ -29,6 +29,6 @@ public async Task NotifySetupChannelMissing_dms_owner_with_setup_instructions()
2929
await notifier.NotifySetupChannelMissingAsync(10UL, 99UL, CancellationToken.None);
3030

3131
await dm.Received(1).SendAsync(99UL,
32-
Arg.Is<string>(m => m.Contains("/setup", StringComparison.Ordinal)), Arg.Any<CancellationToken>());
32+
Arg.Is<string>(m => m!.Contains("/setup", StringComparison.Ordinal)), Arg.Any<CancellationToken>());
3333
}
3434
}

tests/RustPlusBot.Features.Pairing.Tests/PairingHandlerTests.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public async Task NewServerPairing_RoutesToCoordinator_PersistsNothing()
7373
await handler.HandleAsync(10UL, 99UL, ServerPairing(), CancellationToken.None);
7474

7575
await coordinator.Received(1).HandleDetectedAsync(10UL, 99UL,
76-
Arg.Is<PairingNotification>(n => n.Ip == "1.2.3.4" && n.Port == 28015), Arg.Any<CancellationToken>());
76+
Arg.Is<PairingNotification>(n => n!.Ip == "1.2.3.4" && n.Port == 28015), Arg.Any<CancellationToken>());
7777
Assert.Empty(await context.RustServers.ToListAsync());
7878
Assert.Empty(await context.PlayerCredentials.ToListAsync());
7979
await bus.DidNotReceive().PublishAsync(Arg.Any<ServerRegisteredEvent>(), Arg.Any<CancellationToken>());
@@ -128,7 +128,7 @@ public async Task EntityPairing_KnownServer_PublishesSwitchPairedEvent()
128128
await handler.HandleAsync(10UL, 1UL, EntityPairing(FpServer, entityId: 42UL), CancellationToken.None);
129129

130130
await bus.Received(1).PublishAsync(
131-
Arg.Is<SwitchPairedEvent>(e => e.GuildId == 10UL && e.ServerId == server.Id && e.EntityId == 42UL),
131+
Arg.Is<SwitchPairedEvent>(e => e!.GuildId == 10UL && e.ServerId == server.Id && e.EntityId == 42UL),
132132
Arg.Any<CancellationToken>());
133133
}
134134

@@ -160,7 +160,8 @@ public async Task EntityPairing_Alarm_PublishesAlarmPairedEvent_NotSwitch()
160160
await handler.HandleAsync(10UL, 1UL, AlarmPairing(FpServer, 55UL), CancellationToken.None);
161161

162162
await bus.Received(1).PublishAsync(
163-
Arg.Is<AlarmPairedEvent>(e => e.ServerId == server.Id && e.EntityId == 55UL), Arg.Any<CancellationToken>());
163+
Arg.Is<AlarmPairedEvent>(e => e!.ServerId == server.Id && e.EntityId == 55UL),
164+
Arg.Any<CancellationToken>());
164165
await bus.DidNotReceive().PublishAsync(Arg.Any<SwitchPairedEvent>(), Arg.Any<CancellationToken>());
165166
}
166167

@@ -177,7 +178,7 @@ public async Task EntityPairing_StorageMonitor_PublishesStorageMonitorPairedEven
177178
await handler.HandleAsync(10UL, 1UL, StorageMonitorPairing(FpServer, 77UL), CancellationToken.None);
178179

179180
await bus.Received(1).PublishAsync(
180-
Arg.Is<StorageMonitorPairedEvent>(e => e.ServerId == server.Id && e.EntityId == 77UL),
181+
Arg.Is<StorageMonitorPairedEvent>(e => e!.ServerId == server.Id && e.EntityId == 77UL),
181182
Arg.Any<CancellationToken>());
182183
await bus.DidNotReceive().PublishAsync(Arg.Any<SwitchPairedEvent>(), Arg.Any<CancellationToken>());
183184
}

tests/RustPlusBot.Features.Pairing.Tests/ServerPairingCoordinatorTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public async Task Accept_persists_publishes_event_once_and_edits_prompt()
167167
Assert.Equal(server.Id, credential.RustServerId);
168168
Assert.Equal(CredentialStatus.Active, credential.Status);
169169
await h.Bus.Received(1).PublishAsync(
170-
Arg.Is<ServerRegisteredEvent>(e => e.GuildId == 10UL && e.ServerId == server.Id),
170+
Arg.Is<ServerRegisteredEvent>(e => e!.GuildId == 10UL && e.ServerId == server.Id),
171171
Arg.Any<CancellationToken>());
172172
await h.Poster.Received(1).EnsureAsync(777UL, 900UL, Arg.Any<global::Discord.Embed>(),
173173
Arg.Any<global::Discord.MessageComponent>(), Arg.Any<CancellationToken>());
@@ -279,7 +279,7 @@ public async Task Accept_without_setup_channel_still_persists_and_skips_edit()
279279
Assert.Equal(server.Id, credential.RustServerId);
280280
Assert.Equal(CredentialStatus.Active, credential.Status);
281281
await h.Bus.Received(1).PublishAsync(
282-
Arg.Is<ServerRegisteredEvent>(e => e.GuildId == 10UL && e.ServerId == server.Id),
282+
Arg.Is<ServerRegisteredEvent>(e => e!.GuildId == 10UL && e.ServerId == server.Id),
283283
Arg.Any<CancellationToken>());
284284
await h.Poster.Received(1).EnsureAsync(Arg.Any<ulong>(), Arg.Any<ulong?>(),
285285
Arg.Any<global::Discord.Embed>(), Arg.Any<global::Discord.MessageComponent>(),

tests/RustPlusBot.Features.Players.Tests/Hosting/PlayersHostedServiceTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ await h.Bus.PublishAsync(new PlayerStateChangedEvent(
7272
}
7373

7474
await h.Sender.Received().SendAsync(
75-
10UL, serverId, Arg.Is<string>(s => s.Contains("Alice")), Arg.Any<CancellationToken>());
75+
10UL, serverId, Arg.Is<string>(s => s!.Contains("Alice")), Arg.Any<CancellationToken>());
7676

7777
await h.Service.StopAsync(default);
7878
}
@@ -114,7 +114,7 @@ await h.Bus.PublishAsync(new PlayerStateChangedEvent(
114114
// The relay threw, causing the loop to fault and complete (LogRelayLoopFaulted). StopAsync joins the
115115
// faulted task cleanly — no rethrow. This is crash-isolation, not per-event resilience.
116116
await h.Sender.Received().SendAsync(
117-
10UL, Arg.Any<Guid>(), Arg.Is<string>(s => s.Contains("Bob")), Arg.Any<CancellationToken>());
117+
10UL, Arg.Any<Guid>(), Arg.Is<string>(s => s!.Contains("Bob")), Arg.Any<CancellationToken>());
118118
await h.Service.StopAsync(default);
119119
}
120120

0 commit comments

Comments
 (0)