MIT License

项目介绍

bUnit-dev/bUnit 是一个托管在 GitHub 上的开源项目,主要使用 C# 编写,采用 MIT License 许可证,目前获得 1.3k 个 Star、126 次 Fork。

仓库全名
bUnit-dev/bUnit
开源许可证
MIT License
Star 数
1.3k
Fork 数
126
未关闭 Issue
29

README 摘要

bUnit - a testing library for Blazor components 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: Setup and define components under tests using C# or Razor syntax Verify outcomes using semantic HTML comparer Interact with and inspect components as well as trigger event handlers Pass parameters, cascading values and inject…

完整内容见 GitHub 原始 README 或本页 。

常见问题

bUnit 用什么语言开发?

主要使用 C# 编写,采用 MIT License 许可证,目前有 1.3k 个 Star。

bUnit 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 bUnit 的源码?

可以直接克隆仓库:git clone https://github.com/bUnit-dev/bUnit.git,默认分支为 main;安装与运行步骤见仓库 README。

bUnit 最近还在维护吗?

仓库最近一次更新为 22 小时前,当前有 29 个未关闭 Issue;Star 数为 1.3k,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

bUnit is a testing library for Blazor components that make tests look, feel, and runs like regular unit tests. bUnit makes it easy to render and control a component under test’s life-cycle, pass parameter and inject services into it, trigger event handlers, and verify the rendered markup from the component using a built-in semantic HTML comparer.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

C#
CSS
HTML
PowerShell
Shell

Release

README

GitHub tag Nuget Issues Open

bUnit - a testing library for Blazor components

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:

  • Setup and define components under tests using C# or Razor syntax
  • Verify outcomes using semantic HTML comparer
  • Interact with and inspect components as well as trigger event handlers
  • Pass parameters, cascading values and inject services into components under test
  • Mock IJSRuntime, Blazor authentication and authorization, and others

bUnit 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.

NuGet Downloads

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. 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.

bUnit and .NET version compatibility matrix

bUnit version .NET version
1.x ≥ .netcore3.1 && ≤ .net 9
2.x ≥ .net8

For a migration guide, see Upgrading bUnit.

Sponsors

A huge thank you to the sponsors of bUnit. The higher tier sponsors are:


TestMu AI

Contributors

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:

Code of conduct

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.

.NET Foundation

This project is supported by the .NET Foundation.

评论

暂无评论