
csharp-xunit
Comprehensive XUnit testing guide covering standard facts, data-driven theories
by githubFree
Description
csharp-xunit is an agent skill from the github/awesome-copilot collection that guides unit testing in .NET with xUnit, covering standard facts and data-driven theories. It sets up a separate test project named after the production project with a Tests suffix, and references the Microsoft.NET.Test.Sdk, xunit and xunit.runner.visualstudio packages. Test classes match the classes under test, so CalculatorTests covers Calculator, and tests are run with the dotnet test command. The skill's test structure follows the Arrange-Act-Assert pattern, and it sets out naming conventions that make each test's purpose clear from its name. Facts are used for tests with fixed inputs, and theories for data-driven tests that run over many input and expected-output sets. The skill also covers fixture-based setup and teardown, using IClassFixture for shared setup across the tests of one class and ICollectionFixture for setup shared across several test classes. This avoids repeating expensive setup in every test. It is useful for .NET teams that prefer xUnit, which is the default test framework in many newer .NET templates, and for teams setting up tests for a new project. Shared fixtures should be kept free of state that one test can change for another, otherwise the tests stop being independent. The skill is installed with the skills CLI from the github/awesome-copilot repository. Its skills.sh page showed about 10.3K installs and passing results from three security audits at the time of the scan.…
Highlights
- Facts for fixed inputs and theories for data-driven tests
- Arrange-Act-Assert structure
- IClassFixture and ICollectionFixture setup and teardown
- Separate test project with xUnit packages
- Installs with the skills CLI
Ratings & Reviews
No ratings yet
Be the first to rate csharp-xunit.
People also visit
csharp-xunit FAQ
What is the difference between a fact and a theory?
A fact is a test with fixed inputs. A theory is a data-driven test that runs over many input sets.
What are the fixture types?
IClassFixture for setup shared within a test class, and ICollectionFixture for setup shared across classes.
Why keep fixtures free of shared state?
So tests stay independent, since state one test changes could affect another.
How do I install it?
Run npx skills add https://github.com/github/awesome-copilot --skill csharp-xunit.
What security audits does it have?
skills.sh lists three audits: Gen Agent Trust Hub Pass, Socket Pass and Snyk Pass.
What are the best csharp-xunit alternatives?
Popular alternatives to csharp-xunit include csharp-nunit, csharp-docs and csharp-mcp-server-generator. See all csharp-xunit alternatives




