
csharp-nunit
NUnit best practices for standard and data-driven unit testing in .NET projects
by githubFree
Description
csharp-nunit is an agent skill from the github/awesome-copilot collection that sets out best practices for unit testing .NET projects with NUnit, covering both standard and data-driven tests. It recommends a separate test project named after the production project with a Tests suffix, referencing the Microsoft.NET.Test.Sdk, NUnit and NUnit3TestAdapter packages. Test classes match the classes they test, so CalculatorTests tests Calculator, and tests are grouped into TestFixture classes. Test methods use the Test attribute and are named in the form MethodName_Scenario_ExpectedBehavior, so a failing test says what broke and under which condition. Each test follows the Arrange-Act-Assert structure, which keeps the setup, the action and the check easy to see. The skill also covers data-driven tests, where one test runs over many input and expected-output pairs, and it uses the dotnet test command to run the suite. It is useful for .NET teams that are setting up tests for a new project or tidying an existing suite. Tests are only useful when they check real behavior, so the agent should write assertions that would fail if the code were wrong, rather than tests that only confirm the code runs. The skill is installed with the skills CLI from the github/awesome-copilot repository. Its skills.sh page showed about 8.9K installs and passing results from three security audits at the time of the scan.…
Highlights
- Separate test project with NUnit packages
- TestFixture classes matching production code
- MethodName_Scenario_ExpectedBehavior naming
- Arrange-Act-Assert structure
- Data-driven tests and dotnet test
- Installs with the skills CLI
Ratings & Reviews
No ratings yet
Be the first to rate csharp-nunit.
People also visit

csharp-xunit
Comprehensive XUnit testing guide covering standard facts, data-driven theories

creating-oracle-to-postgres-master-migration-plan
Discovers all projects in a .NET solution

creating-oracle-to-postgres-migration-integration-tests
Creates integration test cases targeting Oracle for .NET data access artifacts
csharp-nunit FAQ
Which packages does it use?
Microsoft.NET.Test.Sdk, NUnit and NUnit3TestAdapter, in a separate test project.
How are test methods named?
In the form MethodName_Scenario_ExpectedBehavior.
Does it cover data-driven tests?
Yes. It covers standard and data-driven testing.
How do I install it?
Run npx skills add https://github.com/github/awesome-copilot --skill csharp-nunit.
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-nunit alternatives?
Popular alternatives to csharp-nunit include csharp-xunit, csharp-docs and csharp-mcp-server-generator. See all csharp-nunit alternatives





