December 2019
Intermediate to advanced
510 pages
11h 33m
English
The WebApplicationFactory class exposes set properties and methods that are useful for configuring the instance of the TestServer and for creating the proper tests fixture for our controllers. In addition, it is possible to extend WebApplicationFactory by overriding the ConfigureWebHost method and substituting the behavior of the dependency injection services declared in the original Startup class of the Catalog.API project. The WebApplicationFactory class is part of the Microsoft.AspNetCore.Mvc.Testing package; therefore, it is necessary to add the NuGet package to the Catalog.Fixture project and to the Catalog.API.Tests project by running the following commands in the tests folder of the project:
dotnet ...