From 372dcc3b134efa480b2a81e8027c638d5707ec80 Mon Sep 17 00:00:00 2001 From: FelixKrull Date: Tue, 25 Jan 2022 10:17:07 +0100 Subject: [PATCH] Refactor names of source-method --- src/test/java/GameTest.java | 14 +++----------- src/test/java/PlayerTest.java | 4 ++-- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/test/java/GameTest.java b/src/test/java/GameTest.java index 6480543..bd47a51 100644 --- a/src/test/java/GameTest.java +++ b/src/test/java/GameTest.java @@ -2,20 +2,12 @@ import org.junit.jupiter.api.BeforeEach; public class GameTest { - private Gameboard gb; - private Player p1; - private Player p2; - private Player p3; - private Player p4; + private Game g; + @BeforeEach void setup() { - this.gb = new Gameboard(); - gb.initGameboard(); - p1 = new Player("Rot", 40, 43); - p2 = new Player("Blau", 44, 47); - p3 = new Player("Gelb", 48, 51); - p4 = new Player("GrĂ¼n", 52, 55); + g = new Game(); } } diff --git a/src/test/java/PlayerTest.java b/src/test/java/PlayerTest.java index ac7e92f..fed5ccd 100644 --- a/src/test/java/PlayerTest.java +++ b/src/test/java/PlayerTest.java @@ -48,7 +48,7 @@ public class PlayerTest { } @ParameterizedTest - @MethodSource("FieldStream") + @MethodSource("GameWinTestData") void checkGameWin(String testname, Collection
figures, Collection positions, boolean expectedResult) { Iterator
it = figures.iterator(); Iterator it2 = positions.iterator(); @@ -71,7 +71,7 @@ public class PlayerTest { assertThat(calculatedResult).describedAs("Check Win").isEqualTo(expectedResult); } - static Stream FieldStream() { + static Stream GameWinTestData() { return Stream.of( Arguments.of("No Figures in House", Arrays.asList(