mo-unit-testing

Generate Monica unit test projects with xUnit v3, bUnit, and Res<T> assertions.

13|6|Updated Feb 19, 2025
One-click install
npx skills add https://github.com/Tairitsua/Monica --skill mo-unit-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mo-unit-testing
Source: https://github.com/Tairitsua/Monica/tree/main/.claude/skills/mo-unit-testing
Command: npx skills add https://github.com/Tairitsua/Monica --skill mo-unit-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Monica projects need consistent, reliable unit test structure and shared helpers to avoid fragmented test patterns, brittle assertions, and non-deterministic UI tests; this Skill defines the conventions and workflows to produce repeatable, maintainable tests across modules.

Core Features & Use Cases

  • Shared Test Base: Use tests/Test.Monica for cross-project assertion helpers, localization stubs, and module reset utilities.
  • Naming & Layout: Enforce Test.Monica.* project naming, test class and method naming, and folder structures that mirror source code.
  • Test Stack & Scope: Standardize xUnit v3 for unit tests, bUnit for Blazor UI tests, and prefer in-memory/deterministic seams for stability.
  • Monica-Specific Assertions: Require explicit Res<T> and Res<string> assertions, validate module guide behavior, and test service registration and dependencies.
  • Execution Guidance: Provide WSL dotnet execution rules and a single-build/test process policy to reduce environment-related flakiness.

Quick Start

Create a new tests/Test.Monica.{ProjectName} project using the shared Test.Monica helpers, mirror the source folder layout, assert Res<T> explicitly, and run dotnet test in WSL with Windows paths.

Frequently Asked Questions about mo-unit-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure xUnit v3 unit tests for Monica projects?

Structure xUnit v3 unit tests for Monica projects by mirroring source folder layouts, enforcing Test.Monica.* project naming, and using shared Test.Monica helpers to produce consistent, maintainable test suites across modules.

What is the best way to assert Res<T> results in unit tests?

The best way to assert Res<T> results is using explicit Res<T> and Res<string> assertion rules provided by the shared Test.Monica infrastructure, ensuring reliable facade validations and consistent module guide behavior testing.

Does bUnit UI testing work with Monica Blazor components in-memory?

bUnit UI testing works with Monica Blazor components by preferring in-memory and deterministic test seams, reducing environment-related flakiness and ensuring stable, repeatable UI test execution across modules.

Do I need WSL to run dotnet test commands for Monica test suites?

You need WSL to execute dotnet test commands for Monica test suites because the standard enforces WSL dotnet execution rules and a single-build/test process policy to minimize environment-related flakiness with Windows paths.

Why are my Monica unit tests failing due to fragmented test patterns?

Monica unit tests fail from fragmented test patterns when lacking shared infrastructure; applying standardized Test.Monica helpers, folder mirroring, and deterministic test seams resolves brittle assertions and non-deterministic UI tests.