Reformat/cleanup
All checks were successful
NuGet Package Publish / nuget (push) Successful in 1m10s

This commit is contained in:
Joseph Doherty
2026-02-21 07:53:53 -05:00
parent c6f6d9329a
commit 7ebc2cb567
160 changed files with 7258 additions and 7262 deletions

View File

@@ -1,4 +1,3 @@
using ZB.MOM.WW.CBDDC.Core;
using ZB.MOM.WW.CBDDC.Core.Network;
using ZB.MOM.WW.CBDDC.Network.Leadership;
@@ -21,7 +20,7 @@ public class BullyLeaderElectionServiceTests
}
/// <summary>
/// Verifies that a single node elects itself as leader.
/// Verifies that a single node elects itself as leader.
/// </summary>
[Fact]
public async Task SingleNode_ShouldBecomeLeader()
@@ -48,15 +47,15 @@ public class BullyLeaderElectionServiceTests
}
/// <summary>
/// Verifies that the smallest node ID is elected as leader among LAN peers.
/// Verifies that the smallest node ID is elected as leader among LAN peers.
/// </summary>
[Fact]
public async Task MultipleNodes_SmallestNodeIdShouldBeLeader()
{
var peers = new List<PeerNode>
{
new("node-B", "192.168.1.2:9000", DateTimeOffset.UtcNow, PeerType.LanDiscovered),
new("node-C", "192.168.1.3:9000", DateTimeOffset.UtcNow, PeerType.LanDiscovered)
new("node-B", "192.168.1.2:9000", DateTimeOffset.UtcNow),
new("node-C", "192.168.1.3:9000", DateTimeOffset.UtcNow)
};
var electionService = new BullyLeaderElectionService(
@@ -74,15 +73,15 @@ public class BullyLeaderElectionServiceTests
}
/// <summary>
/// Verifies that the local node is not elected when it is not the smallest node ID.
/// Verifies that the local node is not elected when it is not the smallest node ID.
/// </summary>
[Fact]
public async Task LocalNodeNotSmallest_ShouldNotBeLeader()
{
var peers = new List<PeerNode>
{
new("node-A", "192.168.1.1:9000", DateTimeOffset.UtcNow, PeerType.LanDiscovered),
new("node-B", "192.168.1.2:9000", DateTimeOffset.UtcNow, PeerType.LanDiscovered)
new("node-A", "192.168.1.1:9000", DateTimeOffset.UtcNow),
new("node-B", "192.168.1.2:9000", DateTimeOffset.UtcNow)
};
var electionService = new BullyLeaderElectionService(
@@ -100,14 +99,14 @@ public class BullyLeaderElectionServiceTests
}
/// <summary>
/// Verifies that leadership is re-elected when the current leader fails.
/// Verifies that leadership is re-elected when the current leader fails.
/// </summary>
[Fact]
public async Task LeaderFailure_ShouldReelect()
{
var peers = new List<PeerNode>
{
new("node-A", "192.168.1.1:9000", DateTimeOffset.UtcNow, PeerType.LanDiscovered)
new("node-A", "192.168.1.1:9000", DateTimeOffset.UtcNow)
};
var electionService = new BullyLeaderElectionService(
@@ -136,14 +135,14 @@ public class BullyLeaderElectionServiceTests
}
/// <summary>
/// Verifies that cloud peers are excluded from LAN gateway election.
/// Verifies that cloud peers are excluded from LAN gateway election.
/// </summary>
[Fact]
public async Task CloudPeersExcludedFromElection()
{
var peers = new List<PeerNode>
{
new("node-A", "192.168.1.1:9000", DateTimeOffset.UtcNow, PeerType.LanDiscovered),
new("node-A", "192.168.1.1:9000", DateTimeOffset.UtcNow),
new("cloud-node-Z", "cloud.example.com:9000", DateTimeOffset.UtcNow, PeerType.CloudRemote)
};
@@ -159,4 +158,4 @@ public class BullyLeaderElectionServiceTests
await electionService.Stop();
}
}
}