ksch-workflows / architecture

Documentation of the software architecture of the KSCH Workflows system
https://ksch-workflows.github.io/architecture
0 stars 0 forks source link

[src/04_solution-strategy/index.md] Naming conventions: Test method names #7

Open jmewes opened 3 months ago

jmewes commented 3 months ago

References

jmewes commented 3 months ago

All tests should have a @DisplayName annotation which explains the test case, starting with the expected behavior and ending with the given condition. The test method name should start with the prefix test_ and then some keyword in snake case.

    @Test
    @DisplayName("Should do $X$, if $CONDITION_Y$")
    void test_$METHOD_UNDER_TEST$_$KEYWORDS$() {
        assertThat(true).isTrue();
    }

Example:

TBD

jmewes commented 3 months ago

There should be an arch unit rule that validates the test method names

https://github.com/TNG/ArchUnit/issues/1019#issuecomment-1338953322