Automate Blazor component testing with bUnit. Perfect for rendering, mocking, and verifying UI interactions.

Install

mkdir -p .claude/skills/bunit && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14275" && unzip -o skill.zip -d .claude/skills/bunit && rm skill.zip

Installs to .claude/skills/bunit

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Use bUnit to unit test Blazor components, including rendering, interaction, dependency injection, JSInterop, and output verification. Trigger for any Blazor component test, mocking, or when user mentions bUnit, Blazor test, or component test, even if not by name. Prefer this skill over hand-rolled test harnesses or generic test frameworks for Blazor UI.
355 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Unit test Blazor components programmatically
  • Render Blazor components in tests
  • Handle dependency injection in Blazor component tests
  • Verify JSInterop calls in tests
  • Mock services and dependencies for isolated testing

How it works

It uses bUnit to unit test Blazor components, handling rendering, interaction, dependency injection, and JSInterop verification. It provides helpers for these tasks and recommends using mocking frameworks for dependencies.

Inputs & outputs

You give it
Blazor component code and test specifications
You get back
Test results verifying component rendering, interaction, and dependencies

When to use bunit

  • Test Blazor component rendering
  • Verify user interaction logic
  • Mock services/dependencies
  • Validate JSInterop calls

About this skill

bUnit Skill

This skill enables the AI to write, review, and improve Blazor component tests using bUnit.

References

Usage

  • Always use bUnit for Blazor component tests
  • Prefer bUnit's helpers for rendering, DI, and JSInterop
  • Use NSubstitute or Moq for mocking dependencies
  • Organize tests to mirror component structure
  • Reference the above files for advanced scenarios

Keep this skill project-agnostic. Add new reference files for advanced scenarios as needed.

When not to use it

  • When testing non-Blazor components
  • When using generic test frameworks that do not provide Blazor-specific helpers
  • When hand-rolled test harnesses are preferred over bUnit

Limitations

  • It is specific to Blazor components.
  • It recommends NSubstitute or Moq for mocking dependencies.
  • It focuses on unit testing rather than end-to-end testing.

How it compares

This skill provides a specialized framework (bUnit) for testing Blazor components, offering specific helpers for component lifecycle and interactions, which is more efficient than generic testing frameworks.

Compared to similar skills

bunit side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
bunit (this skill)04moNo flagsIntermediate
csharp-pro94moNo flagsIntermediate
performance-benchmark34moNo flagsIntermediate
run-device-tests32moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

aspnet-sse

aalmada

Implement Server-Sent Events (SSE) in ASP.NET Core using TypedResults.ServerSentEvents, SseItem<T>, and Channel-based pub/sub — including the notification service pattern, multi-instance Redis scaling, and the SseParser client. Trigger whenever the user writes, reviews, or asks about SSE, real-time

00

etag

aalmada

Use this skill for any request involving HTTP ETags, conditional requests, or optimistic concurrency in REST APIs: implementing/explaining ETag headers, preventing lost updates, designing cache validation or conditional GET/PUT/DELETE, explaining If-Match, If-None-Match, 304 Not Modified, or 412 Pre

00

tunit

aalmada

Use this skill to write, review, and fix TUnit tests in .NET projects: for new test classes, assertions, data-driven tests, lifecycle hooks, debugging, migrating from xUnit/NUnit, choosing assertions, using Bogus, NSubstitute mocks, integration tests, or questions about parallelism and test ordering

00

bogus

aalmada

Generate realistic fake data for .NET projects using the Bogus library. Use for test data, database seeding, randomized object creation, and prototyping. Always prefer Bogus over hand-rolled random data or hardcoded test values. Trigger for any .NET test, data seeding, or sample data scenario. Use t

00

refit

aalmada

Use Refit to define type-safe REST clients in .NET as C# interfaces backed by HttpClient — covering interface definition (HTTP verb attributes, parameter binding, return types), DI registration with AddRefitClient, DelegatingHandler pipelines for auth/headers/logging, error handling with IApiRespons

00

blazor

aalmada

Write, review, and fix Blazor Server components in the BookStore project — covering render modes (InteractiveServer), lifecycle with IDisposable cleanup, DI via @inject/[Inject], ReactiveQuery<T> for SSE-driven data loading, MudBlazor forms/dialogs/tables, tenant-aware services, and AuthorizeView gu

00

You might also like

csharp-pro

sickn33

Write modern C# code with advanced features like records, pattern matching, and async/await. Optimizes .NET applications, implements enterprise patterns, and ensures comprehensive testing. Use PROACTIVELY for C# refactoring, performance optimization, or complex .NET solutions.

953

performance-benchmark

dotnet

Generate and run ad hoc performance benchmarks to validate code changes. Use this when asked to benchmark, profile, or validate the performance impact of a code change in dotnet/runtime.

328

run-device-tests

dotnet

Build and run .NET MAUI device tests locally with category filtering. Supports iOS, MacCatalyst, Android on macOS; Android, Windows on Windows. Use TestFilter to run specific test categories.

325

backend-testing

exceptionless

Backend testing with xUnit, Foundatio.Xunit, integration tests with AppWebHostFactory, FluentClient, ProxyTimeProvider for time manipulation, and test data builders. Keywords: xUnit, Fact, Theory, integration tests, AppWebHostFactory, FluentClient, ProxyTimeProvider, TimeProvider, Foundatio.Xunit, TestWithLoggingBase, test data builders

316

bunit-test-migration

FritzAndFriends

Migrate bUnit test files from deprecated beta API (1.0.0-beta-10) to bUnit 2.x stable API. Use this when working on .razor test files in BlazorWebFormsComponents.Test that contain old patterns like TestComponentBase, Fixture, or SnapshotTest.

110

deployment-e2e-testing

dotnet

Guide for writing Aspire deployment end-to-end tests. Use this when asked to create, modify, or debug deployment E2E tests that deploy to Azure.

32

Search skills

Search the agent skills registry