-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
Document unit testing with IHttpClientFactory #7847
Comments
FYI: The first url redirects to https://docs.microsoft.com/nl-nl/aspnet/core/fundamentals/http-requests?view=aspnetcore-2.1 |
@jphellemons Thanks for pointing this out. All of the content on that Wiki page, except for the unit testing, was moved to Docs. |
@scottaddie the unit testing part was exactly what I was looking for. |
@jphellemons Here's a screenshot of what that Wiki page used to contain for unit testing: See also the link above to the xUnit & Moq sample. |
@guardrex please suggest a doc this issue should be attached to. |
@Rick-Anderson Perhaps none because we only keep two unit tests topics (Razor Pages tests & Test controllers), and this doesn't look like it fits neatly into either of them. I think Scott's plan was to make a new topic for this under the Test, debug, and troubleshoot node. |
This should be a new topic. |
@scottaddie we don't have the resources to maintain our current testing docs, so I'm closing this issue. |
This is still a valid request as real world code is unit tested. |
I wrote up a blog post for a helper library for this sort of thing a few years ago if it's of any help to you: https://tech.justeattakeaway.com/2017/10/02/reliably-testing-http-integrations-in-a-dotnet-application/ |
There's a partial example at https://github.com/aspnet/HttpClientFactory/wiki/Consumption-Patterns#unit-testing. This content needs to be added to Docs.
See the xUnit & Moq sample at https://github.com/glennc/httpclientfactorysample/tree/master/test/WebUI.Tests.
The text was updated successfully, but these errors were encountered: