csharp-xunit
Installation
SKILL.md
C# Unit Testing with XUnit v3
Follow these practices when writing, reviewing, or refactoring C# unit tests. The stack is XUnit v3 + NSubstitute + FluentAssertions + Atc.Test. Do not use Moq.
When adding tests to an existing project, read nearby test files first and match the established style before applying these defaults.
Naming and Structure
Name tests ClassName_MethodUnderTest_ExpectedBehavior so the test runner output reads like a specification.
Every test follows the Arrange-Act-Assert pattern with explicit comments:
[Fact]
public void OrderService_CalculateTotal_ReturnsZero_WhenCartIsEmpty()
{
// Arrange
var sut = new OrderService();
var emptyCart = new Cart();