unit-test-specialist

Automate unit testing for .NET 9 projects with xUnit and Moq.

Updated Nov 20, 2025
One-click install
npx skills add https://github.com/manx/PomodoroTimeTracker --skill unit-test-specialist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unit-test-specialist
Source: https://github.com/manx/PomodoroTimeTracker/tree/main/.claude/skills/unit-test-specialist
Command: npx skills add https://github.com/manx/PomodoroTimeTracker --skill unit-test-specialist

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides expert guidance on unit testing for the Pomodoro Time Tracker, helping developers write effective tests, understand testing frameworks, and maintain high code quality. It addresses the challenge of ensuring robust, maintainable, and well-covered tests across the project's layers.

Core Features & Use Cases

  • Framework Guidance: Offers specific patterns and best practices for xUnit, Moq, and FluentAssertions, ensuring consistent and readable tests.
  • Project-Specific Structure: Details the existing test organization across ViewModels, Application, and Infrastructure layers, along with common test patterns for each.
  • Coverage Targets: Sets clear expectations for test coverage and pass rates, guiding efforts to achieve comprehensive validation.
  • Use Case: When you're implementing a new feature, activate this Skill to get immediate advice on how to structure your unit tests, what mocking strategies to use, and how to ensure proper coverage for your new code.

Quick Start

Ask the unit-test-specialist skill for guidance on writing a new unit test for the PomodoroSessionService, focusing on its dependency injection setup.

Frequently Asked Questions about unit-test-specialist

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

FAQPage Schema
How do I structure unit tests for .NET projects using xUnit and Moq?

Structure unit tests using the AAA pattern (Arrange, Act, Assert) with xUnit as your test framework. Use Moq to create mock objects for dependencies, FluentAssertions for readable assertions, and organize tests across ViewModels, Services, and Repositories layers. This ensures consistent, maintainable tests aligned with .NET testing best practices.

What test coverage targets should I aim for in .NET applications?

Aim for 5-8 unit tests per public method with a 100% pass rate. Use in-memory data stores like EF Core InMemory for repository testing to achieve comprehensive coverage. Document coverage in TEST_SUMMARY.md to track progress and maintain accountability across your project layers.

Can I use FluentAssertions with xUnit for .NET testing?

Yes, FluentAssertions integrates seamlessly with xUnit. It provides fluent, readable assertion syntax that improves test clarity and maintainability. Combined with xUnit's test organization and Moq's mocking capabilities, it forms a complete testing framework for .NET projects.

How do I mock dependencies in .NET unit tests?

Use Moq to create mock objects that simulate dependencies for isolation testing. Set up mock behavior in the Arrange phase, invoke methods in the Act phase, and verify interactions in the Assert phase. This enables focused testing of individual components without external dependencies.

What's the best way to test repositories and services in .NET?

Test repositories using EF Core InMemory to simulate database interactions without external dependencies. For services, inject mocked repositories and other dependencies via constructor injection, then verify behavior through assertions and mock verification. This keeps tests fast and isolated.

Do I need to document my unit tests?

Yes, maintain TEST_SUMMARY.md documentation that tracks test coverage, naming conventions, and organizational structure. Clear documentation ensures team alignment, helps onboard new developers, and provides visibility into test quality and coverage across project layers.