Skip to content

Provide documentation (and, or NuGet?) for testing an application which consumes this library. #3

@PureKrome

Description

@PureKrome

Issue

If the main host consumes/uses this library, then when trying to create an integration test (to test the route, etc), the following error occurs:

System.InvalidOperationException : No method 'public static IHostBuilder CreateHostBuilder(string[] args)' or 'public static IWebHostBuilder CreateWebHostBuilder(string[] args)' found on 'API.Program'. Alternatively, WebApplicationFactory`1 can be extended and 'CreateHostBuilder' or 'CreateWebHostBuilder' can be overridden to provide your own instance.

Solution

The reason is, the testing framework is trying to find a hardcoded method name. SimpleHosting has it's own method name and as such, can't be found. Therefore, some documentation is required to explain to a developer how she/he can successfully test (by creating their own custom WebApplicationFactory and possible consider wrapping this into a nuget package.

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationenhancementNew feature or requestgood first issueGood for newcomers

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions