![]() |
VOOZH | about |
dotnet add package bunit.core --version 1.40.0
NuGet\Install-Package bunit.core -Version 1.40.0
<PackageReference Include="bunit.core" Version="1.40.0" />
<PackageVersion Include="bunit.core" Version="1.40.0" />Directory.Packages.props
<PackageReference Include="bunit.core" />Project file
paket add bunit.core --version 1.40.0
#r "nuget: bunit.core, 1.40.0"
#:package bunit.core@1.40.0
#addin nuget:?package=bunit.core&version=1.40.0Install as a Cake Addin
#tool nuget:?package=bunit.core&version=1.40.0Install as a Cake Tool
👁 GitHub tag
👁 Nuget
👁 Issues Open
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, and MSTest, 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 | Includes the bUnit.core and bUnit.web packages. | 👁 Nuget |
| bUnit.core | Core library that enables rendering a Blazor component in a test context. | 👁 Nuget |
| bUnit.web | Adds support for testing Blazor components for the web. This includes bUnit.core. | 👁 Nuget |
| bUnit.template | Template, which currently creates xUnit-based bUnit test projects only. | 👁 Nuget |
| bUnit.generators | Source code generators to minimize code setup in various situations. | 👁 Nuget |
| bUnit.web.query | bUnit implementation of testing-library.com's query APIs. | 👁 Nuget |
To get started, head to the getting started documentation to learn more.
A huge thank you to the sponsors of bUnit. The higher tier sponsors are:
<table border="0"> <tr> <td align="center" width="120"> <a href="https://www.syncfusion.com/blazor-components?utm_source=bunit&utm_medium=cpc&utm_campaign=bunit_blazor_bancy25"> <img class="avatar" src="https://avatars.githubusercontent.com/u/1699795?s=460" width="72" height="72" alt="@syncfusion" /> <br /> Syncfusion </a> </td> <td align="center" width="120"> <a href="https://github.com/JetBrainsOfficial"> <img class="avatar" src="https://avatars.githubusercontent.com/u/60931315?v=4" width="72" height="72" alt="@JetBrainsOfficial" /> <br /> JetBrains </a> </td> </tr> </table>
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:
<a href="https://github.com/bUnit-dev/bUnit/graphs/contributors"> <img src="https://contrib.rocks/image?repo=bUnit-dev/bUnit" /> </a>
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.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 is compatible. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 is compatible. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on bunit.core:
| Package | Downloads |
|---|---|
|
bunit.web
bUnit.web is the web specific parts of bUnit, that enables you to easily test and verify the output of Blazor (web) component. |
|
|
bunit.xunit
bUnit.xunit is an xUnit extension for bUnit, that provides a way for xUnit to run bUnit's razor-based tests, as well as other helpful extensions to make the testing experience better if you use xUnit for writing your tests. |
|
|
BlazorPro.BlazorSize.UnitTesting
A testing library to provide helper extensions for BlazorSize. |
|
|
bunit.web.mock
bUnit.web.mock contains an experimental component stubbing mocking library. This library is in preview, and the logic will likely be added back into bUnit when out of preview. |
|
|
Mythetech.LocalStorage.TestExtensions
A testing library to provide helper extensions for Mythetech.LocalStorage. Fork of Blazored.LocalStorage.TestExtensions. |
Showing the top 4 popular GitHub repositories that depend on bunit.core:
| Repository | Stars |
|---|---|
|
Blazored/LocalStorage
A library to provide access to local storage in Blazor applications
|
|
|
Blazored/Modal
A powerful and customizable modal implementation for Blazor applications.
|
|
|
Blazored/SessionStorage
A library to provide access to session storage in Blazor applications
|
|
|
EdCharbeneau/BlazorSize
Blazor browser size interop for matchMedia and browser window size at runtime.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 1.40.0 | 1,584,708 | 6/14/2025 |
| 1.39.5 | 605,964 | 4/4/2025 |
| 1.38.5 | 786,016 | 1/12/2025 |
| 1.37.7 | 179,075 | 12/13/2024 |
| 1.36.0 | 712,702 | 11/12/2024 |
| 1.35.3 | 28,650 | 11/12/2024 |
| 1.34.0 | 252,092 | 11/1/2024 |
| 1.33.3 | 318,003 | 10/11/2024 |
| 1.33.1-preview | 351 | 10/7/2024 |
| 1.32.7 | 123,417 | 10/4/2024 |
| 1.31.3 | 467,407 | 8/16/2024 |
| 1.31.1-preview | 378 | 8/14/2024 |
| 1.30.3 | 185,917 | 7/21/2024 |
| 1.29.5 | 145,485 | 7/5/2024 |
| 1.28.9 | 721,978 | 4/19/2024 |
| 1.28.4-preview | 7,576 | 3/17/2024 |
| 1.28.2-preview | 948 | 3/6/2024 |
| 1.27.17 | 409,067 | 3/2/2024 |
| 1.27.16-preview | 846 | 3/2/2024 |
| 1.27.12-preview | 1,798 | 2/23/2024 |
Changes in bUnit 1.40.0
### Fixed
- Aligned Microsoft packages to their TFM version
See the full changelog at https://github.com/bUnit-dev/bUnit/releases