{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Docs/issues/6086","repository_url":"https://api.github.com/repos/aspnet/Docs","labels_url":"https://api.github.com/repos/aspnet/Docs/issues/6086/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Docs/issues/6086/comments","events_url":"https://api.github.com/repos/aspnet/Docs/issues/6086/events","html_url":"https://github.com/aspnet/Docs/pull/6086","id":317748549,"number":6086,"title":"Document improved support for integration testing","user":{"login":"guardrex","id":1622880,"avatar_url":"https://avatars1.githubusercontent.com/u/1622880?v=4","gravatar_id":"","url":"https://api.github.com/users/guardrex","html_url":"https://github.com/guardrex","followers_url":"https://api.github.com/users/guardrex/followers","following_url":"https://api.github.com/users/guardrex/following{/other_user}","gists_url":"https://api.github.com/users/guardrex/gists{/gist_id}","starred_url":"https://api.github.com/users/guardrex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardrex/subscriptions","organizations_url":"https://api.github.com/users/guardrex/orgs","repos_url":"https://api.github.com/users/guardrex/repos","events_url":"https://api.github.com/users/guardrex/events{/privacy}","received_events_url":"https://api.github.com/users/guardrex/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":42,"created_at":"2018-04-25T18:44:33Z","updated_at":"2018-05-24T20:54:37Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/aspnet/Docs/pulls/6086","html_url":"https://github.com/aspnet/Docs/pull/6086","diff_url":"https://github.com/aspnet/Docs/pull/6086.diff","patch_url":"https://github.com/aspnet/Docs/pull/6086.patch"},"body":"Fixes #4652 \r\n\r\n[Internal Review Topic](https://review.docs.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-1.0&branch=pr-en-us-6086)\r\n\r\n### Notes\r\n\r\n* Makes a UE pass on the original topic.\r\n* In our quest to move away from gerunds, changing *testing* to *tests*.\r\n* This isn't the *only* way to organize the content, but it is one decent approach. The outline is below.\r\n* I show (and include in the sample app) *per-test class config* with `WithWebHostBuilder` **--AND--** *custom* `WebApplicationFactory`. I think they should both be shown. If we leave either out, then I think we're bound to upset one group of devs or the other.\r\n* We use xUnit ... the topic is xUnit-ish ... the sample uses xUnit. We may need to add more on the use of other test frameworks. It's a management call (i.e., @Rick-Anderson) to say if we need more (or how far to take that). Let's assess this on review.\r\n* I'm a bit concerned that we don't show alternate configuration (e.g., app settings) here. It's not a big deal to add it. We have the test web host config covered well here; so in theory for any sort of custom test web host config the dev needs, they'll be able to work it out from here. However, I have a sneaky feeling that we'll get feedback along the lines of: \"How do I use a different app settings file?\" Let's assess this on review as well.\r\n* Not much to say about RP vs. MVC in this context. What I had to say ... well ... *I said IT!* :smile: lol Let's see if that covers the bases. If not, we'll add more content that goes beyond test class naming.\r\n\r\n### Draft topic outline\r\n\r\n* Integration tests in ASP.NET Core\r\n  * Introduction to integration tests (general info on the basics)\r\n  * Integration tests in ASP.NET Core (more focused specifically on ASP.NET Core testing)\r\n  * Customize the web host and create a client\r\n    * Per-test class configuration\r\n    * Custom WebApplicationFactory implementations\r\n  * Client options\r\n  * How the test infrastructure infers the app content root path\r\n  * Disable shadow copying (xUnit only)\r\n  * Integration tests sample\r\n    * Message app (SUT) organization\r\n    * Test app organization\r\n    * Integration tests of the SUT\r\n  * Additional resources\r\n  \r\nbtw - @scottaddie I guess it's ok that the build is throwing warnings for the duplicate UID's (original topic as <= 2.0 and new topic for >= 2.1) ... that's ok?\r\n"},"comment":{"url":"https://api.github.com/repos/aspnet/Docs/issues/comments/391857738","html_url":"https://github.com/aspnet/Docs/pull/6086#issuecomment-391857738","issue_url":"https://api.github.com/repos/aspnet/Docs/issues/6086","id":391857738,"user":{"login":"guardrex","id":1622880,"avatar_url":"https://avatars1.githubusercontent.com/u/1622880?v=4","gravatar_id":"","url":"https://api.github.com/users/guardrex","html_url":"https://github.com/guardrex","followers_url":"https://api.github.com/users/guardrex/followers","following_url":"https://api.github.com/users/guardrex/following{/other_user}","gists_url":"https://api.github.com/users/guardrex/gists{/gist_id}","starred_url":"https://api.github.com/users/guardrex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardrex/subscriptions","organizations_url":"https://api.github.com/users/guardrex/orgs","repos_url":"https://api.github.com/users/guardrex/repos","events_url":"https://api.github.com/users/guardrex/events{/privacy}","received_events_url":"https://api.github.com/users/guardrex/received_events","type":"User","site_admin":false},"created_at":"2018-05-24T20:54:37Z","updated_at":"2018-05-24T20:54:37Z","author_association":"COLLABORATOR","body":"@javiercn Still a bit on the *raw* side, since I was making quite a few content changes today. I'll pass it over again Friday for more polish. In the meantime tho, the main updates are there.\r\n\r\n* Note: `IClassFixture` isn't in the API browser for some reason: https://docs.microsoft.com/en-us/dotnet/api/?term=IClassFixture\r\n* Walking a fine line here on helper method details ... trying to strike the right balance between not-too-much and not-too-little content.\r\n* Follows your suggested sequence:\r\n   1. Basic tests (OOB `WebApplicationFactory` without customization)\r\n   1. `CustomWebApplicationFactory` class used in a test class\r\n   1. `WithWebHostBuilder` example for further customization\r\n* Added your suggestions for basic tests of:\r\n   1. Routing\r\n   1. Secure page\r\n   1. HTML work, but the GH user bit is only explained lightly. Topic is getting really *L .. O .. N .. G*. I hope this will be enough, but we can expand if you like.\r\n* Updated the shadow copying bit to make it more generic (but it retains the specifics for xUnit).\r\n\r\n[Internal Review Topic](https://review.docs.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-1.0&branch=pr-en-us-6086)"}}
{"actor":{"display_login":"guardrex"}}