Fixes for WireMock.Net.FluentAssertions (callcount behaviour) (#832)

* UsingAnyMethod

* fix

* .
This commit is contained in:
Stef Heyenrath
2022-10-17 21:50:24 +02:00
committed by GitHub
parent fb8fec0376
commit 306c69f478
3 changed files with 66 additions and 24 deletions

View File

@@ -562,6 +562,44 @@ public class WireMockAssertionsTests : IDisposable
.UsingTrace();
}
[Fact]
public async Task HaveReceivedACall_UsingAnyMethod_WhenACallWasMadeUsingGet_Should_BeOK()
{
await _httpClient.SendAsync(new HttpRequestMessage(new HttpMethod("GET"), "anyurl")).ConfigureAwait(false);
_server.Should()
.HaveReceivedACall()
.UsingAnyMethod();
}
[Fact]
public void HaveReceivedNoCalls_UsingAnyMethod_WhenNoCallsWereMade_Should_BeOK()
{
_server
.Should()
.HaveReceived(0)
.Calls()
.UsingAnyMethod();
_server
.Should()
.HaveReceivedNoCalls()
.UsingAnyMethod();
}
[Fact]
public void HaveReceivedNoCalls_AtUrl_WhenNoCallsWereMade_Should_BeOK()
{
_server.Should()
.HaveReceived(0)
.Calls()
.AtUrl(_server.Url ?? string.Empty);
_server.Should()
.HaveReceivedNoCalls()
.AtUrl(_server.Url ?? string.Empty);
}
public void Dispose()
{
_server?.Stop();