xunit-test-arch

Standardize xUnit test project naming, folder layout, and build configuration for .NET class libraries.

3|Updated Mar 18, 2024
One-click install
npx skills add https://github.com/deveel/deveel.events --skill xunit-test-arch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xunit-test-arch
Source: https://github.com/deveel/deveel.events/tree/main/.agents/skills/xunit-test-arch
Command: npx skills add https://github.com/deveel/deveel.events --skill xunit-test-arch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Standardizes the xUnit test architecture for .NET class libraries, providing a reproducible blueprint for project naming, folder layout, and shared build configuration so teams can spin up consistent test environments quickly.

Core Features & Use Cases

  • Standardized project naming conventions (e.g., a MyLib.XUnit executable test project) with a companion MyLib.Testing library for fixtures and shared code
  • Prescribed folder structure separating Unit and Integration tests and supporting fixtures
  • Centralized shared build configuration via Directory.Build.props to align test dependencies and tooling
  • Guidance for multi-targeting frameworks and framework-specific coverage tooling

Quick Start

Create a new xUnit test architecture using this skill to scaffold your .XUnit test project layout for net9.0 and beyond.

Frequently Asked Questions about xunit-test-arch

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

FAQPage Schema
How do I structure xUnit test projects for .NET class libraries?

Standardize xUnit test architecture by creating a MyLib.XUnit executable test project alongside a MyLib.Testing companion library for shared fixtures. Separate Unit and Integration tests into distinct folders to maintain a reproducible project layout and consistent naming conventions across the .NET solution.

What is the best way to share MSBuild configuration across multiple xUnit test projects?

Centralize shared build configuration for xUnit test projects using Directory.Build.props. This approach aligns test dependencies, coverage tooling, and MSBuild conventions across all projects in the solution, ensuring consistent multi-targeting frameworks without duplicating settings in individual .csproj files.

How do I configure multi-targeting for xUnit and coverage packages per target framework?

Configure multi-targeting in xUnit test architecture by selecting framework-specific xUnit and coverage packages via MSBuild conventions. Use Directory.Build.props to manage dependencies per target framework, ensuring accurate coverage tooling across different .NET versions like net9.0.

Does this xUnit test architecture approach work with both unit and integration test organization?

Yes, the xUnit test architecture prescribes a specific folder structure that explicitly separates Unit and Integration tests. It also supports dedicated folders for shared test fixtures within the MyLib.Testing library, keeping different test types organized and isolated.

When should I create a separate Testing library for shared xUnit fixtures?

Establish a companion MyLib.Testing library when scaffolding new xUnit test projects for .NET class libraries. This separates shared code and fixtures from the executable test project, enforcing consistent architecture and making test utilities reusable across multiple test projects.

How do I scaffold a new xUnit test project layout for .NET?

Scaffold a new xUnit test project layout by applying standardized naming conventions, creating the MyLib.XUnit executable project, and setting up Directory.Build.props. This enforces consistent folder structures, multi-targeting, and coverage tooling for .NET versions from net9.0 and beyond.