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

Document unit testing with IHttpClientFactory #7847

Closed
scottaddie opened this issue Jul 27, 2018 · 10 comments
Closed

Document unit testing with IHttpClientFactory #7847

scottaddie opened this issue Jul 27, 2018 · 10 comments
Labels
doc-bug Pri1 High priority, do before Pri2 and Pri3 Pri2 Priority 2
Milestone

Comments

@scottaddie
Copy link
Member

scottaddie commented Jul 27, 2018

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.

@jphellemons
Copy link
Contributor

@scottaddie
Copy link
Member Author

@jphellemons Thanks for pointing this out. All of the content on that Wiki page, except for the unit testing, was moved to Docs.

@jphellemons
Copy link
Contributor

@scottaddie the unit testing part was exactly what I was looking for.

@scottaddie
Copy link
Member Author

@jphellemons Here's a screenshot of what that Wiki page used to contain for unit testing:

image

See also the link above to the xUnit & Moq sample.

@Rick-Anderson Rick-Anderson added Pri1 High priority, do before Pri2 and Pri3 Pri2 Priority 2 labels Oct 19, 2018
@Rick-Anderson
Copy link
Contributor

@guardrex please suggest a doc this issue should be attached to.

@guardrex
Copy link
Collaborator

@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.

@scottaddie
Copy link
Member Author

This should be a new topic.

@Rick-Anderson
Copy link
Contributor

@scottaddie we don't have the resources to maintain our current testing docs, so I'm closing this issue.

@lloydjatkinson
Copy link

This is still a valid request as real world code is unit tested.

@martincostello
Copy link
Member

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-bug Pri1 High priority, do before Pri2 and Pri3 Pri2 Priority 2
Projects
None yet
Development

No branches or pull requests

7 participants