dotnet-testing-test-naming-conventions_skill

This skill helps you name tests and test classes using three-part naming, improving readability and consistency across .NET test suites.
  • C#

19

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-test-naming-conventions

  • SKILL.md8.4 KB

Overview

This skill helps you name .NET tests consistently to improve readability, diagnostics, and team alignment. It codifies a three-part, underscore-separated convention for test method names and a simple pattern for test class names. Use it when creating, reviewing, or standardizing unit and integration test suites.

How this skill works

The skill inspects test method and class names and recommends names following the pattern: Subject_Scenario_Expected. It highlights unclear or generic names, suggests concrete replacements, and offers variants for parameterized tests. It also enforces test class naming as [ClassName]Tests and provides vocabulary for common scenarios and expectations.

When to use it

  • Naming new test methods or test classes
  • Reviewing or refactoring existing test suites for clarity
  • Creating team-wide naming standards or style guides
  • Improving test report readability for CI pipelines
  • Writing parameterized/ Theory tests with descriptive names

Best practices

  • Use Subject_Scenario_Expected separated by underscores (e.g., Add_Input1And2_Returns3)
  • Keep the scenario concise and specific: describe input, state, or precondition
  • Make the expected outcome explicit and verifiable (returns, throws, contains)
  • Name test classes as [ClassName]Tests (e.g., OrderServiceTests)
  • For Theories use words like Various, Valid, Invalid to indicate data sets
  • Avoid vague names like Test1, DoWorkTest, or generic TestMethod

Example use cases

  • Unit test for arithmetic: Add_Input1And2_Returns3
  • Validation test: IsValidEmail_InputNull_ReturnsFalse
  • Business logic: ProcessOrder_InputNull_ThrowsArgumentNullException
  • Parameterized math tests: Add_InputVariousCombinations_ReturnsCorrectSum
  • Test class naming: PriceCalculatorTests with grouped method sections

FAQ

Choose the language that your team reads most comfortably. English is common on open-source projects; localized teams can use their native language for clarity.

How long can a test name be?

Be descriptive but concise. Prefer clear short phrases for subject, scenario, and expected result. If a scenario is long, consider splitting into multiple focused tests.

How to name tests that assert multiple outcomes?

Prefer one assertion per test when possible. If multiple related assertions are required, name the test after the behavior being verified and include all expected results in the expected segment.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
dotnet-testing-test-naming-conventions skill by kevintsengtw/dotnet-testing-agent-skills | VeilStrat