Generates bUnit component unit and integration tests for Blazor components (.razor). Use when the user asks to "write bUnit tests", "test Blazor component", "create UI test for Blazor", or mentions bUnit, Blazor component testing, or xUnit rendering tests.
73
90%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Generate unit and integration tests for Blazor .razor UI components using the bUnit testing library and xUnit.
A diff of the specification change may follow the file path in the arguments. When it is there, it is the definitive list of what changed — work through it change by change. A removed line means the scenario it described was dropped: delete the tests that exist only for it instead of keeping them as passing extras.
Before writing new tests, look for an existing test class for this use case / component (e.g.
UC001_PlaceOrderPageTests.cs, or any test that renders the component). If one exists, update it
to match the current specification and implementation instead of creating a second test class:
Features/UC001_PlaceOrder/PlaceOrderPage.razor).Bunit.TestContext (or use bUnit test fixture).Services.AddSingleton or Services.AddScoped.var authContext = this.AddTestAuthorization();).JSInterop.SetupVoid("localStorage.setItem").SetVoidResult();).var cut = RenderComponent<PlaceOrderPage>();cut.Find("button#submit").Click();OnInitializedAsync), use cut.WaitForState(() => cut.Find(".alert-success").TextContent.Contains("Order Placed")) or cut.WaitForAssertion(() => ...) before making assertions.cut.Find(".alert-success").MarkupMatches("<div class=\"alert-success\">Order Placed!</div>");dotnet test to confirm tests pass."Next step: Run
/playwright-testto generate native C# end-to-end browser tests for your use cases."
c3a5da3
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.