Blazorme.TestHost 26.9.14

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

Blazorme.TestHost

Support library for Blazor component unit testing. The source code is taken from Steve Sanderson's BlazorUnitTestingPrototype project. See his blog post for more details. His project is available only as source code; this package makes it usable as a dependency.

Consider bUnit first

bUnit grew out of the same prototype and is the actively maintained library for this job. For a new test suite, prefer it. This package exists for projects already built on it.

Requirements

Targets net8.0 and net10.0. Earlier versions targeted netstandard2.1 and net5.0; those are no longer supported.

.NET 8 is included deliberately. A net10.0-only package would leave every project on .NET 5 to .NET 9 resolving 1.0.0, which crashes at runtime (see below), so those users would be worse off than before.

Version 1.0.0 did not work on .NET 5 or later, despite advertising that it did. Duplicate PackageReference items meant its net5.0 build was compiled against ASP.NET Core 3.1, whose RenderTreeFrame exposed public fields that became properties in .NET 5. Rendering a component threw MissingFieldException at runtime. Fixed in this release.

Installation

  Install-Package Blazorme.TestHost

Usage

  using Blazorme;

  var host = new TestHost();
  host.AddService<IMyService, IMyService>(myServiceStub);

  var component = host.AddComponent<MyComponent>();

  component.Find("button.submit")?.Click();
  component.GetMarkup().Should().Contain("Saved");

Find returns null when the selector matches nothing; FindAll returns every match. Both accept CSS selectors, resolved by Fizzler over the rendered markup.

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
26.9.14 85 9/14/2026
26.9.7 114 9/7/2026
1.0.0 9,700 12/2/2020 1.0.0 is deprecated because it has critical bugs.

.NET 10 only. The .NET 8 target has been dropped: ASP.NET Core 10.0.x ships no net8.0 assets, so supporting both meant pinning .NET 8 projects to ASP.NET Core 8 indefinitely, and .NET 8 leaves support in November 2026. Projects still on .NET 8 should stay on 26.9.7, which remains available and carries a net8.0 build.