Reformat/cleanup
All checks were successful
NuGet Package Publish / nuget (push) Successful in 1m10s
All checks were successful
NuGet Package Publish / nuget (push) Successful in 1m10s
This commit is contained in:
@@ -6,7 +6,8 @@ namespace ZB.MOM.WW.CBDDC.Core.Tests;
|
||||
public class PeerManagementServiceTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Verifies that removing peer tracking with remote removal enabled removes both tracking and remote peer configuration.
|
||||
/// Verifies that removing peer tracking with remote removal enabled removes both tracking and remote peer
|
||||
/// configuration.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task RemovePeerTrackingAsync_WhenRemoveRemoteConfigTrue_RemovesTrackingAndRemoteConfig()
|
||||
@@ -16,14 +17,14 @@ public class PeerManagementServiceTests
|
||||
var service = new PeerManagementService(configStore, confirmationStore);
|
||||
var token = new CancellationTokenSource().Token;
|
||||
|
||||
await service.RemovePeerTrackingAsync("peer-1", removeRemoteConfig: true, token);
|
||||
await service.RemovePeerTrackingAsync("peer-1", true, token);
|
||||
|
||||
await confirmationStore.Received(1).RemovePeerTrackingAsync("peer-1", token);
|
||||
await configStore.Received(1).RemoveRemotePeerAsync("peer-1", token);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that removing peer tracking with remote removal disabled removes only tracking data.
|
||||
/// Verifies that removing peer tracking with remote removal disabled removes only tracking data.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task RemovePeerTrackingAsync_WhenRemoveRemoteConfigFalse_RemovesTrackingOnly()
|
||||
@@ -32,14 +33,14 @@ public class PeerManagementServiceTests
|
||||
var confirmationStore = Substitute.For<IPeerOplogConfirmationStore>();
|
||||
var service = new PeerManagementService(configStore, confirmationStore);
|
||||
|
||||
await service.RemovePeerTrackingAsync("peer-1", removeRemoteConfig: false);
|
||||
await service.RemovePeerTrackingAsync("peer-1", false);
|
||||
|
||||
await confirmationStore.Received(1).RemovePeerTrackingAsync("peer-1", Arg.Any<CancellationToken>());
|
||||
await configStore.DidNotReceive().RemoveRemotePeerAsync(Arg.Any<string>(), Arg.Any<CancellationToken>());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that removing a remote peer delegates to tracking removal with remote configuration cleanup enabled.
|
||||
/// Verifies that removing a remote peer delegates to tracking removal with remote configuration cleanup enabled.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task RemoveRemotePeerAsync_DelegatesToTrackingRemovalWithRemoteConfig()
|
||||
@@ -56,7 +57,7 @@ public class PeerManagementServiceTests
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that removing peer tracking with an invalid node identifier throws an <see cref="ArgumentException"/>.
|
||||
/// Verifies that removing peer tracking with an invalid node identifier throws an <see cref="ArgumentException" />.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task RemovePeerTrackingAsync_WhenNodeIdInvalid_ThrowsArgumentException()
|
||||
@@ -65,9 +66,10 @@ public class PeerManagementServiceTests
|
||||
var confirmationStore = Substitute.For<IPeerOplogConfirmationStore>();
|
||||
var service = new PeerManagementService(configStore, confirmationStore);
|
||||
|
||||
await Should.ThrowAsync<ArgumentException>(() => service.RemovePeerTrackingAsync(" ", removeRemoteConfig: true));
|
||||
await Should.ThrowAsync<ArgumentException>(() => service.RemovePeerTrackingAsync(" ", true));
|
||||
|
||||
await confirmationStore.DidNotReceive().RemovePeerTrackingAsync(Arg.Any<string>(), Arg.Any<CancellationToken>());
|
||||
await confirmationStore.DidNotReceive()
|
||||
.RemovePeerTrackingAsync(Arg.Any<string>(), Arg.Any<CancellationToken>());
|
||||
await configStore.DidNotReceive().RemoveRemotePeerAsync(Arg.Any<string>(), Arg.Any<CancellationToken>());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user