Skip to content

Commit 4a6dd0f

Browse files
Dennis DoomenCopilot
andcommitted
Add AV1600 guideline
Split from #298. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a0b0bea commit 4a6dd0f

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

_rules/1600.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
rule_id: 1600
3+
rule_category: testability
4+
title: Use short concise functional test names
5+
severity: 2
6+
---
7+
A test name should describe the behavior being verified in plain language, not the implementation detail being exercised. It should read like a sentence that a non-developer can understand.
8+
9+
```csharp
10+
// Avoid
11+
[Fact]
12+
public void Test1() { ... }
13+
14+
[Fact]
15+
public void CalculateTotal_WhenDiscountIsApplied_ShouldReturnReducedAmount() { ... }
16+
17+
// Prefer
18+
[Fact]
19+
public void Total_is_reduced_when_a_discount_is_applied() { ... }
20+
```
21+
22+
Use underscores to separate words if your test framework supports it. Keep names short enough to fit on one line, but long enough to communicate intent without reading the test body.

0 commit comments

Comments
 (0)