Skip to content

Commit

Permalink
* isolated the shutdown node test
Browse files Browse the repository at this point in the history
  • Loading branch information
RagingKore committed Nov 2, 2023
1 parent e8e3182 commit 35bcee4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions test/EventStore.Client.Operations.Tests/MergeIndexesTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace EventStore.Client.Operations.Tests;

public class @admin : IClassFixture<InsecureClientTestFixture> {
public admin(ITestOutputHelper output, InsecureClientTestFixture fixture) =>
public class MergeIndexesTests : IClassFixture<InsecureClientTestFixture> {
public MergeIndexesTests(ITestOutputHelper output, InsecureClientTestFixture fixture) =>
Fixture = fixture.With(x => x.CaptureTestRun(output));

InsecureClientTestFixture Fixture { get; }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace EventStore.Client.Operations.Tests;

public class ShutdownNodeAuthenticationTests : IClassFixture<InsecureClientTestFixture> {
public ShutdownNodeAuthenticationTests(ITestOutputHelper output, InsecureClientTestFixture fixture) =>
Fixture = fixture.With(x => x.CaptureTestRun(output));

InsecureClientTestFixture Fixture { get; }

[Fact]
public async Task shutdown_without_credentials_throws() =>
await Fixture.Operations.ShutdownAsync().ShouldThrowAsync<AccessDeniedException>();
}
8 changes: 1 addition & 7 deletions test/EventStore.Client.Operations.Tests/ShutdownNodeTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using FlakyTest.XUnit.Attributes;

namespace EventStore.Client.Operations.Tests;

public class ShutdownNodeTests : IClassFixture<InsecureClientTestFixture> {
Expand All @@ -9,10 +7,6 @@ public ShutdownNodeTests(ITestOutputHelper output, InsecureClientTestFixture fix
InsecureClientTestFixture Fixture { get; }

[Fact]
public async Task shutdown_does_not_throw() =>
public async Task shutdown_does_not_throw() =>
await Fixture.Operations.ShutdownAsync(userCredentials: TestCredentials.Root).ShouldNotThrowAsync();

[MaybeFixedFact(1)]
public async Task shutdown_without_credentials_throws() =>
await Fixture.Operations.ShutdownAsync().ShouldThrowAsync<AccessDeniedException>();
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ async Task WarmUp() {
}

public async Task InitializeAsync() {
await Service.Start().ShouldNotThrowAsync();
await Service.Start();

await WarmUp();

await OnSetup().ShouldNotThrowAsync("Failed to run OnSetup!");
await OnSetup();
}

public async Task DisposeAsync() {
Expand Down

0 comments on commit 35bcee4

Please sign in to comment.