diff --git a/DistTestCore/AutoBootstrapDistTest.cs b/DistTestCore/AutoBootstrapDistTest.cs index 1ffce5a..2ac0f8d 100644 --- a/DistTestCore/AutoBootstrapDistTest.cs +++ b/DistTestCore/AutoBootstrapDistTest.cs @@ -1,9 +1,9 @@ -namespace DistTestCore +using NUnit.Framework; + +namespace DistTestCore { public class AutoBootstrapDistTest : DistTest { - private IOnlineCodexNode? bootstrapNode; - public override IOnlineCodexNode SetupCodexBootstrapNode(Action setup) { throw new Exception("AutoBootstrapDistTest creates and attaches a single boostrap node for you. " + @@ -14,25 +14,16 @@ { var codexSetup = new CodexSetup(numberOfNodes); setup(codexSetup); - codexSetup.WithBootstrapNode(EnsureBootstapNode()); + codexSetup.WithBootstrapNode(BootstrapNode); return BringOnline(codexSetup); } - protected IOnlineCodexNode BootstrapNode + [SetUp] + public void SetUpBootstrapNode() { - get - { - return EnsureBootstapNode(); - } + BootstrapNode = BringOnline(new CodexSetup(1))[0]; } - private IOnlineCodexNode EnsureBootstapNode() - { - if (bootstrapNode == null) - { - bootstrapNode = base.SetupCodexBootstrapNode(s => { }); - } - return bootstrapNode; - } + protected IOnlineCodexNode BootstrapNode { get; private set; } = null!; } } diff --git a/Tests/PeerDiscoveryTests/PeerDiscoveryTests.cs b/Tests/PeerDiscoveryTests/PeerDiscoveryTests.cs index 23773f5..2b3e4ff 100644 --- a/Tests/PeerDiscoveryTests/PeerDiscoveryTests.cs +++ b/Tests/PeerDiscoveryTests/PeerDiscoveryTests.cs @@ -5,6 +5,7 @@ using Utils; namespace Tests.PeerDiscoveryTests { + [TestFixture] public class PeerDiscoveryTests : AutoBootstrapDistTest { [Test]