This project follows the Clean Code Manual for naming convention for unit and integration test methods.
To improve test readability, maintain consistency, and make it easier to understand what each test is verifying at a glance.
should{ExpectedBehavior}
should: A constant keyword indicating expected behavior.ExpectedBehavior: The specific outcome or behavior expected.
| Method Under Test | Test Method Name | Description |
|---|---|---|
findAll |
shouldReturnAllEvents |
Verifies that findAll() returns all events. |
save |
shouldSaveEventToStorage |
Verifies that save() stores the event. |
deleteById |
shouldRemoveEventFromStorage |
Verifies that deletion by ID works as expected. |
calculateTotal |
shouldReturnCorrectSum |
Verifies correct calculation logic. |
- Use meaningful, concise names for the method and expected behavior.
- Avoid including low-level details unless relevant to the test.
- Apply consistently across all test types (unit, integration, etc.).