Support deleting / resetting a single scenario (#834)

* Support deleting / resetting a single scenario

* move files
This commit is contained in:
Stef Heyenrath
2022-10-26 08:43:51 +02:00
committed by GitHub
parent b4c32dd66b
commit 31298d281d
27 changed files with 186 additions and 179 deletions

View File

@@ -603,5 +603,31 @@ public class WireMockAdminApiTests
server.Stop();
}
[Fact]
public async Task IWireMockAdminApi_DeleteScenarioUsingDeleteAsync()
{
// Arrange
var name = "x";
var server = WireMockServer.StartWithAdminInterface();
var api = RestClient.For<IWireMockAdminApi>(server.Urls[0]);
// Act
var status = await api.DeleteScenarioAsync(name).ConfigureAwait(false);
status.Status.Should().Be("No scenario found by name 'x'.");
}
[Fact]
public async Task IWireMockAdminApi_DeleteScenarioUsingPostAsync()
{
// Arrange
var name = "x";
var server = WireMockServer.StartWithAdminInterface();
var api = RestClient.For<IWireMockAdminApi>(server.Urls[0]);
// Act
var status = await api.ResetScenarioAsync(name).ConfigureAwait(false);
status.Status.Should().Be("No scenario found by name 'x'.");
}
}
#endif

View File

@@ -117,7 +117,7 @@ public class WireMockServerProxyTests
}
// Assert
server.Mappings.Should().HaveCount(28);
server.Mappings.Should().HaveCount(30);
}
[Fact]

View File

@@ -81,7 +81,7 @@ namespace WireMock.Net.Tests
// Assert
server.Mappings.Should().NotBeNull();
server.Mappings.Should().HaveCount(26);
server.Mappings.Should().HaveCount(28);
server.Mappings.All(m => m.Priority == WireMockConstants.AdminPriority).Should().BeTrue();
}
@@ -100,9 +100,9 @@ namespace WireMock.Net.Tests
// Assert
server.Mappings.Should().NotBeNull();
server.Mappings.Should().HaveCount(27);
server.Mappings.Should().HaveCount(29);
server.Mappings.Count(m => m.Priority == WireMockConstants.AdminPriority).Should().Be(26);
server.Mappings.Count(m => m.Priority == WireMockConstants.AdminPriority).Should().Be(28);
server.Mappings.Count(m => m.Priority == WireMockConstants.ProxyPriority).Should().Be(1);
}