2
0
mirror of synced 2025-01-28 17:26:05 +00:00

52 lines
1.3 KiB
C#
Raw Normal View History

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
{
[Test]
public void CanReportUnknownPeerId()
{
var unknownId = "16Uiu2HAkv2CHWpff3dj5iuVNERAp8AGKGNgpGjPexJZHSqUstfsK";
var node = SetupCodexNode();
var result = node.GetDebugPeer(unknownId);
Assert.That(result.IsPeerFound, Is.False);
}
[Test]
public void MetricsDoesNotInterfereWithPeerDiscovery()
{
SetupCodexNodes(2, s => s.EnableMetrics());
AssertAllNodesConnected();
}
[Test]
public void MarketplaceDoesNotInterfereWithPeerDiscovery()
{
SetupCodexNodes(2, s => s.EnableMarketplace(1000.TestTokens()));
AssertAllNodesConnected();
}
2023-05-10 08:53:57 +02:00
[TestCase(2)]
[TestCase(3)]
[TestCase(10)]
[TestCase(20)]
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
AssertAllNodesConnected();
2023-05-10 08:53:57 +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
}
}
}