-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
1,316 additions
and
2,294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Base Registries Unit Testing Guidelines | ||
|
||
## Introduction | ||
This document outlines the guidelines for writing unit tests in C# following the "Given-When-Then" principle and encourages the use of the builder pattern for test data creation. | ||
|
||
## Given-When-Then Principle | ||
We adhere to the "Given-When-Then" principle to structure our unit tests. The test method naming follows the format: | ||
- **Given**: Describes the initial conditions. | ||
- **When**: Describes the action or scenario. | ||
- **Then**: Describes the expected outcome. | ||
|
||
### Folder Structure | ||
- Tests related to "When" should be organized within folders that represent the action or scenario, e.g., "WhenProposingStreetName." | ||
|
||
### Class Structure | ||
- Each test class should correspond to the "Given" part, e.g., "GivenMunicipality." | ||
|
||
### Method Naming | ||
- Test method names should follow the format: "With{Condition}_Then{Outcome}," where: | ||
- "With" represents the condition being set up. | ||
- "Then" represents the expected outcome of the test. | ||
|
||
## Builder Pattern for Test Data | ||
We encourage the use of the builder pattern to create test data. This approach provides a cleaner and more flexible way to set up test scenarios. | ||
|
||
### Test Data Builders | ||
- Create separate test data builder classes or methods for each class under test. | ||
- Builders should have clear and expressive methods for configuring the object's state. | ||
- Default values being set by the builder should be documented in a summary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 0 additions & 48 deletions
48
...ateTests/WhenAddingMunicipalityFacilityLanguage/GivenMunicipalityHasNoFacilityLanguage.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 0 additions & 48 deletions
48
...ateTests/WhenAddingMunicipalityOfficialLanguage/GivenMunicipalityHasNoOfficialLanguage.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.