Setup & Installation
What This Skill Does
Generates NUnit 3 unit tests for C# projects using the Assert.That constraint model. Handles parameterized tests with TestCase and TestCaseSource, lifecycle methods like SetUp and TearDown, and Moq-based mocking for dependencies.
NUnit's constraint model has a lot of syntax variations, and this skill produces correct Assert.That expressions, proper lifecycle hooks, and Moq setups without needing to look up the API each time.
When to use it
- Writing NUnit test fixtures with proper SetUp and TearDown lifecycle
- Converting classic Assert.AreEqual calls to the constraint model
- Creating parameterized tests with TestCase and TestCaseSource attributes
- Mocking repository and service dependencies with Moq in test setup
- Adding test categories and retry attributes for CI test filtering