Soenneker.Tests.HostedUnit 4.0.211

Prefix Reserved
dotnet add package Soenneker.Tests.HostedUnit --version 4.0.211
                    
NuGet\Install-Package Soenneker.Tests.HostedUnit -Version 4.0.211
                    
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="Soenneker.Tests.HostedUnit" Version="4.0.211" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Tests.HostedUnit" Version="4.0.211" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Tests.HostedUnit" />
                    
Project file
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 Soenneker.Tests.HostedUnit --version 4.0.211
                    
#r "nuget: Soenneker.Tests.HostedUnit, 4.0.211"
                    
#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 Soenneker.Tests.HostedUnit@4.0.211
                    
#: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=Soenneker.Tests.HostedUnit&version=4.0.211
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Tests.HostedUnit&version=4.0.211
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Tests.HostedUnit

A hosted test that provides synthetic inversion of control via TestHost. Its most used function is Resolve{T}, which retrieves a service from the host service provider.

Install

dotnet add package Soenneker.Tests.HostedUnit

Quick start

using Soenneker.Tests.HostedUnit.Abstract;

IHostedUnitTest hostedUnitTest = /* resolve from DI */;
var result = hostedUnitTest.Resolve();

Resolves a service from the host service provider.

What you get

  • IHostedUnitTest — A hosted test that provides synthetic inversion of control via TestHost. Its most used function is Resolve{T}, which retrieves a service from the host service provider.

API at a glance

API What it does Result / important behavior
IHostedUnitTest.Resolve(scoped) Resolves a service from the host service provider. The resulting value.
IHostedUnitTest.CreateScope() Creates a scope for resolving scoped services. Usually you will want to use Resolve{T} instead.
IHostedUnitTest.WaitOnQueueToEmpty(cancellationToken) Checks the background queue until it is empty. A task that completes when the wait on queue to empty operation is complete.

Important behavior

  • IHostedUnitTest.Resolve(scoped): Optionally creates a scope if needed, if one does not already exist.
  • IHostedUnitTest.CreateScope(): Usually you will want to use Resolve{T} instead.

Practical notes

  • Cancellation stops pending work; it does not undo work that has already completed.
  • Dispose instances you own when their scope ends so held resources can be released.
Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.Tests.HostedUnit:

Package Downloads
Soenneker.Playwrights.Tests.Unit

A fixtured unit test for testing with Playwright

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.211 0 8/30/2026
4.0.210 0 8/29/2026
4.0.209 0 8/29/2026
4.0.207 2,107 8/27/2026
4.0.206 163 8/27/2026
4.0.205 1,351 8/27/2026
4.0.204 2,710 8/26/2026
4.0.203 717 8/26/2026
4.0.202 1,163 8/26/2026
4.0.201 684 8/26/2026
4.0.200 471 8/26/2026
4.0.199 1,026 8/25/2026
4.0.198 5,099 8/22/2026
4.0.197 1,752 8/22/2026
4.0.196 4,950 8/21/2026
4.0.195 1,614 8/20/2026
4.0.194 1,275 8/20/2026
4.0.193 2,836 8/19/2026
4.0.192 1,033 8/19/2026
4.0.191 2,533 8/18/2026
Loading failed