cs-codex-dist-tests/Tests/PeerDiscoveryTests/PeerDiscoveryTests.cs

51 lines
1.2 KiB
C#
Raw Normal View History

using DistTestCore;
2023-05-10 06:53:57 +00:00
using NUnit.Framework;
namespace Tests.PeerDiscoveryTests
{
2023-05-10 07:09:31 +00:00
[TestFixture]
2023-05-10 06:53:57 +00:00
public class PeerDiscoveryTests : AutoBootstrapDistTest
{
[TestCase(2)]
[TestCase(3)]
[TestCase(10)]
public void VariableNodes(int number)
{
SetupCodexNodes(number);
2023-05-10 06:53:57 +00:00
AssertAllNodesConnected();
2023-05-10 06:53:57 +00:00
}
[TestCase(2)]
[TestCase(3)]
[TestCase(10)]
public void VariableNodesInPods(int number)
{
for (var i = 0; i < number; i++)
{
SetupCodexNode();
2023-05-10 06:53:57 +00:00
}
AssertAllNodesConnected();
2023-05-10 06:53:57 +00:00
}
[TestCase(3, 3)]
[TestCase(3, 5)]
[TestCase(3, 10)]
public void StagedVariableNodes(int numberOfNodes, int numberOfStages)
{
for (var i = 0; i < numberOfStages; i++)
{
SetupCodexNodes(numberOfNodes);
AssertAllNodesConnected();
}
}
private void AssertAllNodesConnected()
2023-05-10 06:53:57 +00:00
{
PeerTestHelpers.AssertFullyConnected(GetAllOnlineCodexNodes(), GetTestLog());
2023-05-10 06:53:57 +00:00
}
}
}