Skip to content

Commit dcd5b68

Browse files
Update documentation for INTL0003 to explain test method exception
Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
1 parent 1e62f60 commit dcd5b68

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

docs/analyzers/00XX.Naming.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ class SomeClass
4949

5050
Methods, including local functions, should be PascalCase
5151

52+
**Note:** Test methods decorated with test framework attributes (e.g., `[TestMethod]`, `[Fact]`, `[Theory]`, `[Test]`) are exempt from this rule, as they commonly use underscores for readability (e.g., `Method_Scenario_ExpectedResult`).
53+
5254
**Allowed**
5355
```c#
5456
class SomeClass
@@ -66,6 +68,19 @@ class SomeClass
6668
}
6769
```
6870

71+
**Allowed (Test Methods)**
72+
```c#
73+
[TestClass]
74+
public class SomeClassTests
75+
{
76+
[TestMethod]
77+
public void GetEmpty_WhenCalled_ReturnsEmptyString()
78+
{
79+
// Test implementation
80+
}
81+
}
82+
```
83+
6984
**Disallowed**
7085
```c#
7186
class SomeClass

0 commit comments

Comments
 (0)