mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-25 10:19:04 +02:00
Fix new Delete with body missing from IWireMockAdminApi interface (#413)
* Fix new Delete with body missing from IWireMockAdminApi interface * Admin Delete with mappings in body (#409) * Add unit test for delete with body * change order of checks for readability. looks nicer. * Allow body in DELETE requests * Fix unit tests according to DELETE supporting body * Re-run CI * Fix DELETE with body unit test * Fix ElementAt index in mappings list * Fix DELETE with body unit test * Fix theory tag must be accompanied by some InlineData or Member * Fix didn't use correct checking syntax * Fix wrap entire unit test in if region
This commit is contained in:
@@ -160,12 +160,10 @@ namespace WireMock.Net.Tests
|
||||
Check.That(response.Headers.Contains("Transfer-Encoding")).IsFalse();
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("DELETE")]
|
||||
#if !NET452
|
||||
[Theory]
|
||||
[InlineData("TRACE")]
|
||||
[InlineData("GET")]
|
||||
#endif
|
||||
public async Task WireMockServer_Should_exclude_body_for_methods_where_body_is_definitely_disallowed(string method)
|
||||
{
|
||||
// Assign
|
||||
@@ -189,12 +187,14 @@ namespace WireMock.Net.Tests
|
||||
// Assert
|
||||
Check.That(response.StatusCode).Equals(HttpStatusCode.OK);
|
||||
}
|
||||
#endif
|
||||
|
||||
[Theory]
|
||||
[InlineData("POST")]
|
||||
[InlineData("PUT")]
|
||||
[InlineData("OPTIONS")]
|
||||
[InlineData("REPORT")]
|
||||
[InlineData("DELETE")]
|
||||
[InlineData("SOME-UNKNOWN-METHOD")] // default behavior for unknown methods is to allow a body (see BodyParser.ShouldParseBody)
|
||||
public async Task WireMockServer_Should_not_exclude_body_for_supported_methods(string method)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user