Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ Each problem/submodule has three source sets:

### Update/sync Gradle versions

Please read [How to Update Gradle](../reference/how-to-update-gradle.md)
Please read [How to Update Gradle](reference/how-to-update-gradle.md)

## Contributing to Concept Exercises

Expand Down
2 changes: 1 addition & 1 deletion exercises/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ page at http://checkstyle.sourceforge.net/config.html -->
<module name="MethodNameCheck">
<!-- Validates identifiers for method names. -->
<metadata name="altname" value="MethodName" />
<property name="format" value="^[a-z][a-zA-Z0-9]*(_[a-zA-Z0-9]+)*$" />
<property name="format" value="^[a-z][a-zA-Z0-9]*$" />
<property name="severity" value="error" />
</module>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ public class AnnalynsInfiltrationTest {
@Test
@Tag("task:1")
@DisplayName("The canFastAttack method returns false when knight is awake")
public void cannot_execute_fast_attack_if_knight_is_awake() {
public void cannotExecuteFastAttackIfKnightIsAwake() {
boolean knightIsAwake = true;
assertThat(AnnalynsInfiltration.canFastAttack(knightIsAwake)).isFalse();
}

@Test
@Tag("task:1")
@DisplayName("The canFastAttack method returns true when knight is sleeping")
public void can_execute_fast_attack_if_knight_is_sleeping() {
public void canExecuteFastAttackIfKnightIsSleeping() {
boolean knightIsAwake = false;
assertThat(AnnalynsInfiltration.canFastAttack(knightIsAwake)).isTrue();
}

@Test
@Tag("task:2")
@DisplayName("The canSpy method returns false when everyone is sleeping")
public void cannot_spy_if_everyone_is_sleeping() {
public void cannotSpyIfEveryoneIsSleeping() {
boolean knightIsAwake = false;
boolean archerIsAwake = false;
boolean prisonerIsAwake = false;
Expand All @@ -35,7 +35,7 @@ public void cannot_spy_if_everyone_is_sleeping() {
@Test
@Tag("task:2")
@DisplayName("The canSpy method returns true when everyone but knight is sleeping")
public void can_spy_if_everyone_but_knight_is_sleeping() {
public void canSpyIfEveryoneButKnightIsSleeping() {
boolean knightIsAwake = true;
boolean archerIsAwake = false;
boolean prisonerIsAwake = false;
Expand All @@ -45,7 +45,7 @@ public void can_spy_if_everyone_but_knight_is_sleeping() {
@Test
@Tag("task:2")
@DisplayName("The canSpy method returns true when everyone but archer is sleeping")
public void can_spy_if_everyone_but_archer_is_sleeping() {
public void canSpyIfEveryoneButArcherIsSleeping() {
boolean knightIsAwake = false;
boolean archerIsAwake = true;
boolean prisonerIsAwake = false;
Expand All @@ -55,7 +55,7 @@ public void can_spy_if_everyone_but_archer_is_sleeping() {
@Test
@Tag("task:2")
@DisplayName("The canSpy method returns true when everyone but prisoner is sleeping")
public void can_spy_if_everyone_but_prisoner_is_sleeping() {
public void canSpyIfEveryoneButPrisonerIsSleeping() {
boolean knightIsAwake = false;
boolean archerIsAwake = false;
boolean prisonerIsAwake = true;
Expand All @@ -65,7 +65,7 @@ public void can_spy_if_everyone_but_prisoner_is_sleeping() {
@Test
@Tag("task:2")
@DisplayName("The canSpy method returns true when only knight is sleeping")
public void can_spy_if_only_knight_is_sleeping() {
public void canSpyIfOnlyKnightIsSleeping() {
boolean knightIsAwake = false;
boolean archerIsAwake = true;
boolean prisonerIsAwake = true;
Expand All @@ -75,7 +75,7 @@ public void can_spy_if_only_knight_is_sleeping() {
@Test
@Tag("task:2")
@DisplayName("The canSpy method returns true when only archer is sleeping")
public void can_spy_if_only_archer_is_sleeping() {
public void canSpyIfOnlyArcherIsSleeping() {
boolean knightIsAwake = true;
boolean archerIsAwake = false;
boolean prisonerIsAwake = true;
Expand All @@ -85,7 +85,7 @@ public void can_spy_if_only_archer_is_sleeping() {
@Test
@Tag("task:2")
@DisplayName("The canSpy method returns true when only prisoner is sleeping")
public void can_spy_if_only_prisoner_is_sleeping() {
public void canSpyIfOnlyPrisonerIsSleeping() {
boolean knightIsAwake = true;
boolean archerIsAwake = true;
boolean prisonerIsAwake = false;
Expand All @@ -95,7 +95,7 @@ public void can_spy_if_only_prisoner_is_sleeping() {
@Test
@Tag("task:2")
@DisplayName("The canSpy method returns true when everyone is awake")
public void can_spy_if_everyone_is_awake() {
public void canSpyIfEveryoneIsAwake() {
boolean knightIsAwake = true;
boolean archerIsAwake = true;
boolean prisonerIsAwake = true;
Expand All @@ -105,7 +105,7 @@ public void can_spy_if_everyone_is_awake() {
@Test
@Tag("task:3")
@DisplayName("The canSignalPrisoner method returns true when prisoner is awake and archer is sleeping")
public void can_signal_prisoner_if_archer_is_sleeping_and_prisoner_is_awake() {
public void canSignalPrisonerIfArcherIsSleepingAndPrisonerIsAwake() {
boolean archerIsAwake = false;
boolean prisonerIsAwake = true;
assertThat(AnnalynsInfiltration.canSignalPrisoner(archerIsAwake, prisonerIsAwake)).isTrue();
Expand All @@ -114,7 +114,7 @@ public void can_signal_prisoner_if_archer_is_sleeping_and_prisoner_is_awake() {
@Test
@Tag("task:3")
@DisplayName("The canSignalPrisoner method returns false when prisoner is sleeping and archer is awake")
public void cannot_signal_prisoner_if_archer_is_awake_and_prisoner_is_sleeping() {
public void cannotSignalPrisonerIfArcherIsAwakeAndPrisonerIsSleeping() {
boolean archerIsAwake = true;
boolean prisonerIsAwake = false;
assertThat(AnnalynsInfiltration.canSignalPrisoner(archerIsAwake, prisonerIsAwake)).isFalse();
Expand All @@ -123,7 +123,7 @@ public void cannot_signal_prisoner_if_archer_is_awake_and_prisoner_is_sleeping()
@Test
@Tag("task:3")
@DisplayName("The canSignalPrisoner method returns false when both prisoner and archer are sleeping")
public void cannot_signal_prisoner_if_archer_and_prisoner_are_both_sleeping() {
public void cannotSignalPrisonerIfArcherAndPrisonerAreBothSleeping() {
boolean archerIsAwake = false;
boolean prisonerIsAwake = false;
assertThat(AnnalynsInfiltration.canSignalPrisoner(archerIsAwake, prisonerIsAwake)).isFalse();
Expand All @@ -132,7 +132,7 @@ public void cannot_signal_prisoner_if_archer_and_prisoner_are_both_sleeping() {
@Test
@Tag("task:3")
@DisplayName("The canSignalPrisoner method returns false when both prisoner and archer are awake")
public void cannot_signal_prisoner_if_archer_and_prisoner_are_both_awake() {
public void cannotSignalPrisonerIfArcherAndPrisonerAreBothAwake() {
boolean archerIsAwake = true;
boolean prisonerIsAwake = true;
assertThat(AnnalynsInfiltration.canSignalPrisoner(archerIsAwake, prisonerIsAwake)).isFalse();
Expand All @@ -141,7 +141,7 @@ public void cannot_signal_prisoner_if_archer_and_prisoner_are_both_awake() {
@Test
@Tag("task:4")
@DisplayName("The canFreePrisoner method returns false when everyone is awake and pet dog is present")
public void cannot_release_prisoner_if_everyone_is_awake_and_pet_dog_is_present() {
public void cannotReleasePrisonerIfEveryoneIsAwakeAndPetDogIsPresent() {
boolean knightIsAwake = true;
boolean archerIsAwake = true;
boolean prisonerIsAwake = true;
Expand All @@ -153,7 +153,7 @@ public void cannot_release_prisoner_if_everyone_is_awake_and_pet_dog_is_present(
@Test
@Tag("task:4")
@DisplayName("The canFreePrisoner method returns false when everyone is awake and pet dog is absent")
public void cannot_release_prisoner_if_everyone_is_awake_and_pet_dog_is_absent() {
public void cannotReleasePrisonerIfEveryoneIsAwakeAndPetDogIsAbsent() {
boolean knightIsAwake = true;
boolean archerIsAwake = true;
boolean prisonerIsAwake = true;
Expand All @@ -165,7 +165,7 @@ public void cannot_release_prisoner_if_everyone_is_awake_and_pet_dog_is_absent()
@Test
@Tag("task:4")
@DisplayName("The canFreePrisoner method returns true when everyone is sleeping and pet dog is present")
public void can_release_prisoner_if_everyone_is_asleep_and_pet_dog_is_present() {
public void canReleasePrisonerIfEveryoneIsAsleepAndPetDogIsPresent() {
boolean knightIsAwake = false;
boolean archerIsAwake = false;
boolean prisonerIsAwake = false;
Expand All @@ -177,7 +177,7 @@ public void can_release_prisoner_if_everyone_is_asleep_and_pet_dog_is_present()
@Test
@Tag("task:4")
@DisplayName("The canFreePrisoner method returns false when everyone is sleeping and pet dog is absent")
public void cannot_release_prisoner_if_everyone_is_asleep_and_pet_dog_is_absent() {
public void cannotReleasePrisonerIfEveryoneIsAsleepAndPetDogIsAbsent() {
boolean knightIsAwake = false;
boolean archerIsAwake = false;
boolean prisonerIsAwake = false;
Expand All @@ -189,7 +189,7 @@ public void cannot_release_prisoner_if_everyone_is_asleep_and_pet_dog_is_absent(
@Test
@Tag("task:4")
@DisplayName("The canFreePrisoner method returns true when only prisoner is awake and pet dog is present")
public void can_release_prisoner_if_only_prisoner_is_awake_and_pet_dog_is_present() {
public void canReleasePrisonerIfOnlyPrisonerIsAwakeAndPetDogIsPresent() {
boolean knightIsAwake = false;
boolean archerIsAwake = false;
boolean prisonerIsAwake = true;
Expand All @@ -201,7 +201,7 @@ public void can_release_prisoner_if_only_prisoner_is_awake_and_pet_dog_is_presen
@Test
@Tag("task:4")
@DisplayName("The canFreePrisoner method returns true when only prisoner is awake and pet dog is absent")
public void can_release_prisoner_if_only_prisoner_is_awake_and_pet_dog_is_absent() {
public void canReleasePrisonerIfOnlyPrisonerIsAwakeAndPetDogIsAbsent() {
boolean knightIsAwake = false;
boolean archerIsAwake = false;
boolean prisonerIsAwake = true;
Expand All @@ -213,7 +213,7 @@ public void can_release_prisoner_if_only_prisoner_is_awake_and_pet_dog_is_absent
@Test
@Tag("task:4")
@DisplayName("The canFreePrisoner method returns false when only archer is awake and pet dog is present")
public void cannot_release_prisoner_if_only_archer_is_awake_and_pet_dog_is_present() {
public void cannotReleasePrisonerIfOnlyArcherIsAwakeAndPetDogIsPresent() {
boolean knightIsAwake = false;
boolean archerIsAwake = true;
boolean prisonerIsAwake = false;
Expand All @@ -225,7 +225,7 @@ public void cannot_release_prisoner_if_only_archer_is_awake_and_pet_dog_is_prese
@Test
@Tag("task:4")
@DisplayName("The canFreePrisoner method returns false when only archer is awake and pet dog is absent")
public void cannot_release_prisoner_if_only_archer_is_awake_and_pet_dog_is_absent() {
public void cannotReleasePrisonerIfOnlyArcherIsAwakeAndPetDogIsAbsent() {
boolean knightIsAwake = false;
boolean archerIsAwake = true;
boolean prisonerIsAwake = false;
Expand All @@ -237,7 +237,7 @@ public void cannot_release_prisoner_if_only_archer_is_awake_and_pet_dog_is_absen
@Test
@Tag("task:4")
@DisplayName("The canFreePrisoner method returns true when only knight is awake and pet dog is present")
public void can_release_prisoner_if_only_knight_is_awake_and_pet_dog_is_present() {
public void canReleasePrisonerIfOnlyKnightIsAwakeAndPetDogIsPresent() {
boolean knightIsAwake = true;
boolean archerIsAwake = false;
boolean prisonerIsAwake = false;
Expand All @@ -249,7 +249,7 @@ public void can_release_prisoner_if_only_knight_is_awake_and_pet_dog_is_present(
@Test
@Tag("task:4")
@DisplayName("The canFreePrisoner method returns false when only knight is awake and pet dog is absent")
public void cannot_release_prisoner_if_only_knight_is_awake_and_pet_dog_is_absent() {
public void cannotReleasePrisonerIfOnlyKnightIsAwakeAndPetDogIsAbsent() {
boolean knightIsAwake = true;
boolean archerIsAwake = false;
boolean prisonerIsAwake = false;
Expand All @@ -261,7 +261,7 @@ public void cannot_release_prisoner_if_only_knight_is_awake_and_pet_dog_is_absen
@Test
@Tag("task:4")
@DisplayName("The canFreePrisoner method returns false when only knight is sleeping and pet dog is present")
public void cannot_release_prisoner_if_only_knight_is_asleep_and_pet_dog_is_present() {
public void cannotReleasePrisonerIfOnlyKnightIsAsleepAndPetDogIsPresent() {
boolean knightIsAwake = false;
boolean archerIsAwake = true;
boolean prisonerIsAwake = true;
Expand All @@ -273,7 +273,7 @@ public void cannot_release_prisoner_if_only_knight_is_asleep_and_pet_dog_is_pres
@Test
@Tag("task:4")
@DisplayName("The canFreePrisoner method returns false when only knight is sleeping and pet dog is absent")
public void cannot_release_prisoner_if_only_knight_is_asleep_and_pet_dog_is_absent() {
public void cannotReleasePrisonerIfOnlyKnightIsAsleepAndPetDogIsAbsent() {
boolean knightIsAwake = false;
boolean archerIsAwake = true;
boolean prisonerIsAwake = true;
Expand All @@ -285,7 +285,7 @@ public void cannot_release_prisoner_if_only_knight_is_asleep_and_pet_dog_is_abse
@Test
@Tag("task:4")
@DisplayName("The canFreePrisoner method returns true when only archer is sleeping and pet dog is present")
public void can_release_prisoner_if_only_archer_is_asleep_and_pet_dog_is_present() {
public void canReleasePrisonerIfOnlyArcherIsAsleepAndPetDogIsPresent() {
boolean knightIsAwake = true;
boolean archerIsAwake = false;
boolean prisonerIsAwake = true;
Expand All @@ -297,7 +297,7 @@ public void can_release_prisoner_if_only_archer_is_asleep_and_pet_dog_is_present
@Test
@Tag("task:4")
@DisplayName("The canFreePrisoner method returns false when only archer is sleeping and pet dog is absent")
public void cannot_release_prisoner_if_only_archer_is_asleep_and_pet_dog_is_absent() {
public void cannotReleasePrisonerIfOnlyArcherIsAsleepAndPetDogIsAbsent() {
boolean knightIsAwake = true;
boolean archerIsAwake = false;
boolean prisonerIsAwake = true;
Expand All @@ -309,7 +309,7 @@ public void cannot_release_prisoner_if_only_archer_is_asleep_and_pet_dog_is_abse
@Test
@Tag("task:4")
@DisplayName("The canFreePrisoner method returns false when only prisoner is sleeping and pet dog is present")
public void cannot_release_prisoner_if_only_prisoner_is_asleep_and_pet_dog_is_present() {
public void cannotReleasePrisonerIfOnlyPrisonerIsAsleepAndPetDogIsPresent() {
boolean knightIsAwake = true;
boolean archerIsAwake = true;
boolean prisonerIsAwake = false;
Expand All @@ -321,7 +321,7 @@ public void cannot_release_prisoner_if_only_prisoner_is_asleep_and_pet_dog_is_pr
@Test
@Tag("task:4")
@DisplayName("The canFreePrisoner method returns false when only prisoner is sleeping and pet dog is absent")
public void cannot_release_prisoner_if_only_prisoner_is_asleep_and_pet_dog_is_absent() {
public void cannotReleasePrisonerIfOnlyPrisonerIsAsleepAndPetDogIsAbsent() {
boolean knightIsAwake = true;
boolean archerIsAwake = true;
boolean prisonerIsAwake = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,36 @@ public class FootballMatchReportsTest {
@Test
@Tag("task:1")
@DisplayName("The onField method returns the correct description of player with shirt number 1")
public void test_goal() {
public void testGoal() {
assertThat(FootballMatchReports.onField(1)).isEqualTo("goalie");
}

@Test
@Tag("task:1")
@DisplayName("The onField method returns the correct description of player with shirt number 2")
public void test_left_back() {
public void testLeftBack() {
assertThat(FootballMatchReports.onField(2)).isEqualTo("left back");
}

@Test
@Tag("task:1")
@DisplayName("The onField method returns the correct description of player with shirt number 5")
public void test_right_back() {
public void testRightBack() {
assertThat(FootballMatchReports.onField(5)).isEqualTo("right back");
}

@Test
@Tag("task:1")
@DisplayName("The onField method returns the correct description of players with shirt numbers 3 and 4")
public void test_center_back() {
public void testCenterBack() {
assertThat(FootballMatchReports.onField(3)).isEqualTo("center back");
assertThat(FootballMatchReports.onField(4)).isEqualTo("center back");
}

@Test
@Tag("task:1")
@DisplayName("The onField method returns the correct description of players with shirt numbers 6, 7 and 8")
public void test_midfielder() {
public void testMidfielder() {
assertThat(FootballMatchReports.onField(6)).isEqualTo("midfielder");
assertThat(FootballMatchReports.onField(7)).isEqualTo("midfielder");
assertThat(FootballMatchReports.onField(8)).isEqualTo("midfielder");
Expand All @@ -47,35 +47,35 @@ public void test_midfielder() {
@Test
@Tag("task:1")
@DisplayName("The onField method returns the correct description of player with shirt number 9")
public void test_left_wing() {
public void testLeftWing() {
assertThat(FootballMatchReports.onField(9)).isEqualTo("left wing");
}

@Test
@Tag("task:1")
@DisplayName("The onField method returns the correct description of player with shirt number 10")
public void test_striker() {
public void testStriker() {
assertThat(FootballMatchReports.onField(10)).isEqualTo("striker");
}

@Test
@Tag("task:1")
@DisplayName("The onField method returns the correct description of player with shirt number 11")
public void test_right_wing() {
public void testRightWing() {
assertThat(FootballMatchReports.onField(11)).isEqualTo("right wing");
}

@Test
@Tag("task:2")
@DisplayName("The onField method returns 'invalid' for invalid shirt number")
public void test_exception() {
public void testException() {
assertThat(FootballMatchReports.onField(13)).isEqualTo("invalid");
}

@Test
@Tag("task:2")
@DisplayName("The onField method returns 'invalid' for negative shirt number")
public void test_exception_negative_number() {
public void testExceptionNegativeNumber() {
assertThat(FootballMatchReports.onField(-1)).isEqualTo("invalid");
}
}
Loading