csharp-nunit
Get best practices for NUnit unit testing, including data-driven tests
Target: Software development & testing. Automatically collected · unverified.
Excerpt from the author’s documentation
Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.
Read the original English text
Topics in the source
- NUnit Best Practices
- Project Setup
- Test Structure
- Standard Tests
- Data-Driven Tests
- Assertions
- Mocking and Isolation
- Test Organization
Your goal is to help me write effective unit tests with NUnit, covering both standard and data-driven testing approaches. Use a separate test project with naming convention [ProjectName].Tests Reference Microsoft.NET.Test.Sdk, NUnit, and NUnit3TestAdapter packages Create test classes that match the classes being tested (e.g., CalculatorTests for Calculator) Use .NET SDK test commands: dotnet test for running tests Apply [TestFixture] attribute to test classes Use [Test] attribute for test methods Follow the Arrange-Act-Assert (AAA) pattern Name tests using the pattern MethodNameScenarioExpectedBehavior Use [SetUp] and [TearDown] for per-test setup and teardown Use [OneTimeSetUp] and [OneTimeTearDown] for per-class setup and teardown Use [SetUpFixture] for assembly-level setup and teardown Keep tests focused on a single behavior Avoid testing multiple behaviors in one test method Use clear assertions that express intent Include only the assertions needed to verify the test case Make tests independent and idempotent (can run in any order) Avoid test interdependencies Use [TestCase] for inline test data Use [TestCaseSource] for programmatically generated test data Use [Values] for sim
This is an excerpt. Refer to the complete source and its current requirements.
- Source repository
- OKHP3/skillz
- Source file
- community/csharp-nunit/SKILL.md
- Fixed revision
- 7b187777d42ab7bc7bab1e5f2c940cd3139ecebf
Sources and evidence
This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.
Author: OKHP3/skillz · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-10T10:00:54.127Z.
Categories are inferred from names, descriptions and paths. They do not establish compatibility.
License and attribution
MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.
Original license ↗Synchronization, copying and user-reported success do not mark a resource as runtime-tested.
Limitations and notes
- Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.