Skip to content

Commit 405e34e

Browse files
committed
Add naming conventions for test classes and methods in xUnit documentation
1 parent 41232aa commit 405e34e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

docs/UnitTest/1 Basics.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,10 @@ public class MathUtilTest
5757
Assert.Equal(3, result);
5858
}
5959
}
60-
```
60+
```
61+
62+
### Naming Conventions
63+
- Class Naming: Use the name of the class being tested followed by "Tests". For example, `MathUtilTests`.
64+
- Test Method Naming: Use descriptive names that indicate the method being tested and the expected outcome. For example
65+
- `<MethodName>_Should<ExpectedBehavior>_When<Condition>`
66+
- `Add_ShouldReturnSum_WhenGivenTwoIntegers`

0 commit comments

Comments
 (0)