{"id":"87501d7d-758c-4eb5-95fb-940ed874c76d","shortId":"a9EhtP","kind":"skill","title":"csharp-nunit","tagline":"Get best practices for NUnit unit testing, including data-driven tests","description":"# NUnit Best Practices\n\nYour goal is to help me write effective unit tests with NUnit, covering both standard and data-driven testing approaches.\n\n## Project Setup\n\n- Use a separate test project with naming convention `[ProjectName].Tests`\n- Reference Microsoft.NET.Test.Sdk, NUnit, and NUnit3TestAdapter packages\n- Create test classes that match the classes being tested (e.g., `CalculatorTests` for `Calculator`)\n- Use .NET SDK test commands: `dotnet test` for running tests\n\n## Test Structure\n\n- Apply `[TestFixture]` attribute to test classes\n- Use `[Test]` attribute for test methods\n- Follow the Arrange-Act-Assert (AAA) pattern\n- Name tests using the pattern `MethodName_Scenario_ExpectedBehavior`\n- Use `[SetUp]` and `[TearDown]` for per-test setup and teardown\n- Use `[OneTimeSetUp]` and `[OneTimeTearDown]` for per-class setup and teardown\n- Use `[SetUpFixture]` for assembly-level setup and teardown\n\n## Standard Tests\n\n- Keep tests focused on a single behavior\n- Avoid testing multiple behaviors in one test method\n- Use clear assertions that express intent\n- Include only the assertions needed to verify the test case\n- Make tests independent and idempotent (can run in any order)\n- Avoid test interdependencies\n\n## Data-Driven Tests\n\n- Use `[TestCase]` for inline test data\n- Use `[TestCaseSource]` for programmatically generated test data\n- Use `[Values]` for simple parameter combinations\n- Use `[ValueSource]` for property or method-based data sources\n- Use `[Random]` for random numeric test values\n- Use `[Range]` for sequential numeric test values\n- Use `[Combinatorial]` or `[Pairwise]` for combining multiple parameters\n\n## Assertions\n\n- Use `Assert.That` with constraint model (preferred NUnit style)\n- Use constraints like `Is.EqualTo`, `Is.SameAs`, `Contains.Item`\n- Use `Assert.AreEqual` for simple value equality (classic style)\n- Use `CollectionAssert` for collection comparisons\n- Use `StringAssert` for string-specific assertions\n- Use `Assert.Throws<T>` or `Assert.ThrowsAsync<T>` to test exceptions\n- Use descriptive messages in assertions for clarity on failure\n\n## Mocking and Isolation\n\n- Consider using Moq or NSubstitute alongside NUnit\n- Mock dependencies to isolate units under test\n- Use interfaces to facilitate mocking\n- Consider using a DI container for complex test setups\n\n## Test Organization\n\n- Group tests by feature or component\n- Use categories with `[Category(\"CategoryName\")]`\n- Use `[Order]` to control test execution order when necessary\n- Use `[Author(\"DeveloperName\")]` to indicate ownership\n- Use `[Description]` to provide additional test information\n- Consider `[Explicit]` for tests that shouldn't run automatically\n- Use `[Ignore(\"Reason\")]` to temporarily skip tests","tags":["csharp","nunit","awesome","copilot","github","agent-skills","agents","custom-agents","github-copilot","hacktoberfest","prompt-engineering"],"capabilities":["skill","source-github","skill-csharp-nunit","topic-agent-skills","topic-agents","topic-awesome","topic-custom-agents","topic-github-copilot","topic-hacktoberfest","topic-prompt-engineering"],"categories":["awesome-copilot"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/github/awesome-copilot/csharp-nunit","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add github/awesome-copilot","source_repo":"https://github.com/github/awesome-copilot","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 33270 github stars · SKILL.md body (2,728 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:52:09.224Z","embedding":null,"createdAt":"2026-04-18T20:26:04.250Z","updatedAt":"2026-05-18T18:52:09.224Z","lastSeenAt":"2026-05-18T18:52:09.224Z","tsv":"'aaa':101 'act':99 'addit':357 'alongsid':302 'appli':83 'approach':39 'arrang':98 'arrange-act-assert':97 'assembl':137 'assembly-level':136 'assert':100,161,168,243,277,289 'assert.areequal':259 'assert.that':245 'assert.throws':279 'assert.throwsasync':281 'attribut':85,91 'author':348 'automat':368 'avoid':151,185 'base':218 'behavior':150,154 'best':5,17 'calcul':70 'calculatortest':68 'case':174 'categori':334,336 'categorynam':337 'clariti':291 'class':60,64,88,129 'classic':264 'clear':160 'collect':269 'collectionassert':267 'combin':210,240 'combinatori':236 'command':75 'comparison':270 'complex':322 'compon':332 'consid':297,316,360 'constraint':247,253 'contain':320 'contains.item':257 'control':341 'convent':49 'cover':31 'creat':58 'csharp':2 'csharp-nunit':1 'data':13,36,189,197,204,219 'data-driven':12,35,188 'depend':305 'descript':286,354 'developernam':349 'di':319 'dotnet':76 'driven':14,37,190 'e.g':67 'effect':26 'equal':263 'except':284 'execut':343 'expectedbehavior':110 'explicit':361 'express':163 'facilit':314 'failur':293 'featur':330 'focus':146 'follow':95 'generat':202 'get':4 'goal':20 'group':327 'help':23 'idempot':179 'ignor':370 'includ':11,165 'independ':177 'indic':351 'inform':359 'inlin':195 'intent':164 'interdepend':187 'interfac':312 'is.equalto':255 'is.sameas':256 'isol':296,307 'keep':144 'level':138 'like':254 'make':175 'match':62 'messag':287 'method':94,158,217 'method-bas':216 'methodnam':108 'microsoft.net.test.sdk':53 'mock':294,304,315 'model':248 'moq':299 'multipl':153,241 'name':48,103 'necessari':346 'need':169 'net':72 'nsubstitut':301 'numer':225,232 'nunit':3,8,16,30,54,250,303 'nunit3testadapter':56 'one':156 'onetimesetup':123 'onetimeteardown':125 'order':184,339,344 'organ':326 'ownership':352 'packag':57 'pairwis':238 'paramet':209,242 'pattern':102,107 'per':117,128 'per-class':127 'per-test':116 'practic':6,18 'prefer':249 'programmat':201 'project':40,46 'projectnam':50 'properti':214 'provid':356 'random':222,224 'rang':229 'reason':371 'refer':52 'run':79,181,367 'scenario':109 'sdk':73 'separ':44 'sequenti':231 'setup':41,112,119,130,139,324 'setupfixtur':134 'shouldn':365 'simpl':208,261 'singl':149 'skill' 'skill-csharp-nunit' 'skip':374 'sourc':220 'source-github' 'specif':276 'standard':33,142 'string':275 'string-specif':274 'stringassert':272 'structur':82 'style':251,265 'teardown':114,121,132,141 'temporarili':373 'test':10,15,28,38,45,51,59,66,74,77,80,81,87,90,93,104,118,143,145,152,157,173,176,186,191,196,203,226,233,283,310,323,325,328,342,358,363,375 'testcas':193 'testcasesourc':199 'testfixtur':84 'topic-agent-skills' 'topic-agents' 'topic-awesome' 'topic-custom-agents' 'topic-github-copilot' 'topic-hacktoberfest' 'topic-prompt-engineering' 'unit':9,27,308 'use':42,71,89,105,111,122,133,159,192,198,205,211,221,228,235,244,252,258,266,271,278,285,298,311,317,333,338,347,353,369 'valu':206,227,234,262 'valuesourc':212 'verifi':171 'write':25","prices":[{"id":"64d40457-f3be-4dd9-93d5-200f233c6834","listingId":"87501d7d-758c-4eb5-95fb-940ed874c76d","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"github","category":"awesome-copilot","install_from":"skills.sh"},"createdAt":"2026-04-18T20:26:04.250Z"}],"sources":[{"listingId":"87501d7d-758c-4eb5-95fb-940ed874c76d","source":"github","sourceId":"github/awesome-copilot/csharp-nunit","sourceUrl":"https://github.com/github/awesome-copilot/tree/main/skills/csharp-nunit","isPrimary":false,"firstSeenAt":"2026-04-18T21:49:01.454Z","lastSeenAt":"2026-05-18T18:52:09.224Z"},{"listingId":"87501d7d-758c-4eb5-95fb-940ed874c76d","source":"skills_sh","sourceId":"github/awesome-copilot/csharp-nunit","sourceUrl":"https://skills.sh/github/awesome-copilot/csharp-nunit","isPrimary":true,"firstSeenAt":"2026-04-18T20:26:04.250Z","lastSeenAt":"2026-05-07T22:40:18.609Z"}],"details":{"listingId":"87501d7d-758c-4eb5-95fb-940ed874c76d","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"github","slug":"csharp-nunit","github":{"repo":"github/awesome-copilot","stars":33270,"topics":["agent-skills","agents","ai","awesome","custom-agents","github-copilot","hacktoberfest","prompt-engineering"],"license":"mit","html_url":"https://github.com/github/awesome-copilot","pushed_at":"2026-05-18T01:26:59Z","description":"Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.","skill_md_sha":"7890775bdf2391baf6b05f633a7150603a1ee987","skill_md_path":"skills/csharp-nunit/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/github/awesome-copilot/tree/main/skills/csharp-nunit"},"layout":"multi","source":"github","category":"awesome-copilot","frontmatter":{"name":"csharp-nunit","description":"Get best practices for NUnit unit testing, including data-driven tests"},"skills_sh_url":"https://skills.sh/github/awesome-copilot/csharp-nunit"},"updatedAt":"2026-05-18T18:52:09.224Z"}}