Skip to content

Commit d9977c5

Browse files
committed
docs: update test conventions in Copilot custom instructions file
- Add Given_When_Then pattern for test method naming with example
1 parent b31bfef commit d9977c5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/copilot-instructions.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,13 @@ This project follows a **layered architecture** with clear separation of concern
7777

7878
## 🧪 Testing
7979

80-
- Use **xUnit**
80+
- Use **xUnit** with `[Fact]` and `[Theory]` attributes
8181
- Use **Moq** for mocking
8282
- Prefer testing **service logic** and **controller behavior**
8383
- Place unit tests under `test/` following structure already present (e.g., `Unit/PlayerServiceTests.cs`)
84+
- **Test Naming**: Follow `Given_When_Then` pattern (e.g., `GivenCreateAsync_WhenRepositoryAddAsync_ThenAddsPlayerToRepositoryAndRemovesCache`)
85+
- **Test Structure**: Use Arrange, Act, Assert comments to organize test code
86+
- **Test Attributes**: Add `[Trait("Category", "Unit")]` to all unit tests
8487
- **Test Data**: Use faker patterns for consistent test data generation
8588
- **Assertions**: FluentAssertions for readable test assertions
8689

0 commit comments

Comments
 (0)