
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
bUnit is a testing library for Blazor components. You can easily define components under test in C# or Razor syntax and verify outcome using semantic HTML diffing/comparison logic. You can interact with and inspect the component under test, trigger event handlers, provide cascading values, and inject services. bUnit also includes a complete fake implementation of Blazor's authentication and authorization logic, navigation manager, and JSInterop.
bUnit is a testing library for Blazor Components. Its goal is to make it easy to write comprehensive, stable unit tests. With bUnit, you can:
IJSRuntime, Blazor authentication and authorization, and othersbUnit builds on top of existing unit testing frameworks such as xUnit, NUnit, MSTest and TUnit, which run the Blazor component tests in just the same way as any normal unit test. bUnit runs a test in milliseconds, compared to browser-based UI tests which usually take seconds to run.
Go to bUnit.dev to learn more.
bUnit is available on NuGet in various incarnations. Most should just pick the bUnit package:
| Name | Description | NuGet Download Link |
|---|---|---|
| bUnit | Adds support for testing Blazor components. | |
| bUnit.template | Template, which currently creates xUnit-based bUnit test projects only. | |
| bUnit.generators | Source code generators to minimize code setup in various situations. | |
| bUnit.web.query | bUnit implementation of testing-library.com's query APIs. |
To get started, head to the getting started documentation to learn more.
| bUnit version | .NET version |
|---|---|
| 1.x | ≥ .netcore3.1 && ≤ .net 9 |
| 2.x | ≥ .net8 |
For a migration guide, see Upgrading bUnit.
A huge thank you to the sponsors of bUnit. The higher tier sponsors are:
LambdaTest |
Shout outs and a big thank you to all the contributors to the library, including those that raise issues, provide input to issues, and those who send pull requests. Thank you!
These good people have contributed code or documentation to bUnit:
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information see the .NET Foundation Code of Conduct.
This project is supported by the .NET Foundation.
FAQs
bUnit is a testing library for Blazor components. You can easily define components under test in C# or Razor syntax and verify outcome using semantic HTML diffing/comparison logic. You can interact with and inspect the component under test, trigger event handlers, provide cascading values, and inject services. bUnit also includes a complete fake implementation of Blazor's authentication and authorization logic, navigation manager, and JSInterop.
We found that bunit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.