Create Method
Definition
- Namespace
- Codebelt.Extensions.Xunit.Hosting.AspNetCore
- Assemblies
- Codebelt.Extensions.Xunit.Hosting.AspNetCore.dll
Create<TEntryPoint>(Action<IWebHostBuilder>, IWebApplicationFixture<TEntryPoint>)
Creates and returns an IHostTest implementation.
public static IHostTest Create<TEntryPoint>(Action<IWebHostBuilder> webHostSetup = null, IWebApplicationFixture<TEntryPoint> hostFixture = null) where TEntryPoint : class
Parameters
webHostSetupAction<IWebHostBuilder>The IWebHostBuilder which may be configured.
hostFixtureIWebApplicationFixture<TEntryPoint>An optional IWebApplicationFixture<TEntryPoint> implementation to use instead of the default ManagedWebApplicationFixture<TEntryPoint> instance.
Returns
Type Parameters
TEntryPointA type in the entry point assembly of the application.
Remarks
When hostFixture is omitted, the factory uses ManagedWebApplicationFixture<TEntryPoint> so the application entry point owns deferred host startup. Pass another IWebApplicationFixture<TEntryPoint> implementation when the test requires a different lifecycle.