Microsoft.Extensions.Hosting.Testing
10.10.0-preview.1.26459.2
Prefix Reserved
.NET 8.0
This package targets .NET 8.0. The package is compatible with this framework or higher.
.NET Framework 4.6.2
This package targets .NET Framework 4.6.2. The package is compatible with this framework or higher.
This is a prerelease version of Microsoft.Extensions.Hosting.Testing.
dotnet add package Microsoft.Extensions.Hosting.Testing --version 10.10.0-preview.1.26459.2
NuGet\Install-Package Microsoft.Extensions.Hosting.Testing -Version 10.10.0-preview.1.26459.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.Extensions.Hosting.Testing" Version="10.10.0-preview.1.26459.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.Extensions.Hosting.Testing" Version="10.10.0-preview.1.26459.2" />
<PackageReference Include="Microsoft.Extensions.Hosting.Testing" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Microsoft.Extensions.Hosting.Testing --version 10.10.0-preview.1.26459.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Microsoft.Extensions.Hosting.Testing, 10.10.0-preview.1.26459.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Microsoft.Extensions.Hosting.Testing@10.10.0-preview.1.26459.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Microsoft.Extensions.Hosting.Testing&version=10.10.0-preview.1.26459.2&prerelease
#tool nuget:?package=Microsoft.Extensions.Hosting.Testing&version=10.10.0-preview.1.26459.2&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Microsoft.Extensions.Hosting.Testing
Tools for integration testing of apps built with Microsoft.Extensions.Hosting.
Install the package
From the command-line:
dotnet add package Microsoft.Extensions.Hosting.Testing
Or directly in the C# project file:
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting.Testing" Version="[CURRENTVERSION]" />
</ItemGroup>
Usage Example
FakeHost
FakeHost enables creating an application host pre-configured for a unit test environment.
The host can be created using the following APIs:
public static IHostBuilder CreateBuilder()
public static IHostBuilder CreateBuilder(Action<FakeHostOptions> configure)
public static IHostBuilder CreateBuilder(FakeHostOptions options)
For example:
using var host = await FakeHost.CreateBuilder(options => { });
.ConfigureServices(x =>
{
// ...
})
.StartAsync();
FakeHostingExtensions
FakeHostingExtensions is a collection of IHost and IHostBuilder extension methods for use within a unit test environment. These help collect logs as well as augment the host and app configurations.
Feedback & Contributing
For any feedback or contributions, please visit us in our GitHub repo.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.