TestServer comes in a package (#18969)

pull/18967/head
Rick Anderson 2020-06-25 14:41:15 -10:00 committed by GitHub
parent 80446f1dd8
commit 43ae480ffc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -30,6 +30,14 @@ In the test project, create a test:
* Build and start a host that uses <xref:Microsoft.AspNetCore.TestHost.TestServer>.
* Add any required services that the middleware uses.
* Add the [Microsoft.AspNetCore.TestHost](https://www.nuget.org/packages/Microsoft.AspNetCore.TestHost/) NuGet package to the project:
```dotnetcli
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="3.1.*" />
</ItemGroup>
```
* Configure the processing pipeline to use the middleware for the test.
[!code-csharp[](middleware/samples_snapshot/3.x/setup.cs?highlight=4-18)]