Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FluentAssertions - assert the server has not received a call #753

Closed
MeuLee opened this issue May 10, 2022 · 2 comments
Closed

FluentAssertions - assert the server has not received a call #753

MeuLee opened this issue May 10, 2022 · 2 comments
Assignees
Labels

Comments

@MeuLee
Copy link

MeuLee commented May 10, 2022

Is your feature request related to a problem? Please describe.
Using HaveReceived(0).Calls() throws an exception if no calls have been made.
"Expected StubServer to have been called at address matching the absolute url "https://localhost:62040/path/to/the/resource", but no calls were made."

Describe the solution you'd like
HaveReceived(0).Calls() should validate that no calls have been made to the stub server, optionally taking into account the specifications such as .AtAbsoluteUrl()
I suppose the method was not intended to be used this way, but I think it would be neat to leverage WireMock.FluentAssertions for this kind of tests.
A use case I have in mind is for caching server responses.

Describe alternatives you've considered
I am currently using the following - just FluentAssertions, not the WireMock version.

StubServer.LogEntries.Should().NotContain(logEntry => logEntry.RequestMessage.Path == "/path/to/the/resource");
@MeuLee MeuLee added the feature label May 10, 2022
@StefH
Copy link
Collaborator

StefH commented May 11, 2022

@MeuLee
Good point. I'll take a look.

@StefH StefH self-assigned this May 11, 2022
@StefH
Copy link
Collaborator

StefH commented May 13, 2022

Will be fixed in new version.

@StefH StefH closed this as completed May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants