36 lines
860 B
C#
Raw Normal View History

2025-01-16 13:51:29 +01:00
using CodexClient;
using CodexPlugin;
2025-04-25 15:42:13 +02:00
using NUnit.Framework;
2023-09-12 15:43:30 +02:00
namespace CodexTests
2023-09-12 15:43:30 +02:00
{
public class AutoBootstrapDistTest : CodexDistTest
2023-09-12 15:43:30 +02:00
{
private bool isBooting = false;
2025-04-25 15:42:13 +02:00
public ICodexNode BootstrapNode { get; private set; } = null!;
[SetUp]
public void SetupBootstrapNode()
2023-09-12 15:43:30 +02:00
{
2025-04-25 15:42:13 +02:00
isBooting = true;
BootstrapNode = StartCodex(s => s.WithName("BOOTSTRAP_" + GetTestNamespace()));
isBooting = false;
}
2025-04-25 15:42:13 +02:00
[TearDown]
public void TearDownBootstrapNode()
{
2025-04-25 15:42:13 +02:00
BootstrapNode.Stop(waitTillStopped: false);
}
protected override void OnCodexSetup(ICodexSetup setup)
{
if (isBooting) return;
var node = BootstrapNode;
if (node != null) setup.WithBootstrapNode(node);
2023-09-12 15:43:30 +02:00
}
}
}