Remove "Shadow copying" section from integration testing guide (#23092)

* Remove "Shadow copying" section from integration testing guide

* Delete xunit.runner.json

* Keep shadow copying section but mention when it's needed

Co-authored-by: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com>
pull/23594/head
Gabriel Majeri 2021-10-21 21:53:23 +03:00 committed by GitHub
parent 0252159b15
commit e3a9128588
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View File

@ -327,9 +327,9 @@ The `WebApplicationFactory` constructor infers the app [content root](xref:funda
## Disable shadow copying
Shadow copying causes the tests to execute in a different directory than the output directory. For tests to work properly, shadow copying must be disabled. The [sample app](https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/test/integration-tests/samples) uses xUnit and disables shadow copying for xUnit by including an `xunit.runner.json` file with the correct configuration setting. For more information, see the [xUnit documentation](https://xunit.net/docs/configuration-files).
Shadow copying causes the tests to execute in a different directory than the output directory. If your tests rely on loading files relative to `Assembly.Location` and you encounter issues, you might have to disable shadow copying.
Add the `xunit.runner.json` file to root of the test project with the following content:
To disable shadow copying when using xUnit, create a `xunit.runner.json` file in your test project directory, with the [correct configuration setting](https://xunit.net/docs/configuration-files#shadowCopy):
```json
{