2
0
mirror of synced 2025-01-11 09:06:56 +00:00
cs-codex-dist-tests/DistTestCore/AutoBootstrapDistTest.cs

30 lines
988 B
C#
Raw Normal View History

2023-05-10 09:09:31 +02:00
using NUnit.Framework;
namespace DistTestCore
{
public class AutoBootstrapDistTest : DistTest
{
public override IOnlineCodexNode SetupCodexBootstrapNode(Action<ICodexSetup> setup)
{
throw new Exception("AutoBootstrapDistTest creates and attaches a single boostrap node for you. " +
"If you want to control the bootstrap node from your test, please use DistTest instead.");
}
public override ICodexNodeGroup SetupCodexNodes(int numberOfNodes, Action<ICodexSetup> setup)
{
2023-05-31 13:34:12 +02:00
var codexSetup = CreateCodexSetup(numberOfNodes);
setup(codexSetup);
2023-05-10 09:09:31 +02:00
codexSetup.WithBootstrapNode(BootstrapNode);
return BringOnline(codexSetup);
}
2023-05-10 09:09:31 +02:00
[SetUp]
public void SetUpBootstrapNode()
2023-05-10 08:53:57 +02:00
{
2023-05-31 13:34:12 +02:00
BootstrapNode = BringOnline(CreateCodexSetup(1))[0];
2023-05-10 08:53:57 +02:00
}
2023-05-10 09:09:31 +02:00
protected IOnlineCodexNode BootstrapNode { get; private set; } = null!;
}
}