2023-05-10 09:55:36 +02:00
|
|
|
|
using DistTestCore;
|
2023-05-10 08:53:57 +02:00
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
|
|
namespace Tests.PeerDiscoveryTests
|
|
|
|
|
{
|
2023-05-10 09:09:31 +02:00
|
|
|
|
[TestFixture]
|
2023-05-10 08:53:57 +02:00
|
|
|
|
public class PeerDiscoveryTests : AutoBootstrapDistTest
|
|
|
|
|
{
|
2023-05-31 13:15:41 +02:00
|
|
|
|
[Test]
|
|
|
|
|
public void CanReportUnknownPeerId()
|
|
|
|
|
{
|
|
|
|
|
var unknownId = "16Uiu2HAkv2CHWpff3dj5iuVNERAp8AGKGNgpGjPexJZHSqUstfsK";
|
|
|
|
|
var node = SetupCodexNode();
|
|
|
|
|
|
|
|
|
|
var result = node.GetDebugPeer(unknownId);
|
|
|
|
|
Assert.That(result.IsPeerFound, Is.False);
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-10 08:53:57 +02:00
|
|
|
|
[TestCase(2)]
|
|
|
|
|
[TestCase(3)]
|
|
|
|
|
[TestCase(10)]
|
2023-05-31 13:15:41 +02:00
|
|
|
|
[TestCase(20)]
|
2023-08-24 15:56:56 +02:00
|
|
|
|
public void VariableNodes(int number)
|
2023-05-10 08:53:57 +02:00
|
|
|
|
{
|
2023-08-24 15:32:08 +02:00
|
|
|
|
SetupCodexNodes(number);
|
2023-05-10 08:53:57 +02:00
|
|
|
|
|
2023-05-10 09:55:36 +02:00
|
|
|
|
AssertAllNodesConnected();
|
2023-05-10 08:53:57 +02:00
|
|
|
|
}
|
|
|
|
|
|
2023-05-10 09:55:36 +02:00
|
|
|
|
private void AssertAllNodesConnected()
|
2023-05-10 08:53:57 +02:00
|
|
|
|
{
|
2023-08-24 10:59:11 +02:00
|
|
|
|
CreatePeerConnectionTestHelpers().AssertFullyConnected(GetAllOnlineCodexNodes());
|
2023-05-10 08:53:57 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|