diff --git a/src/main/java/Figure.java b/src/main/java/Figure.java new file mode 100644 index 0000000..8cf72b9 --- /dev/null +++ b/src/main/java/Figure.java @@ -0,0 +1,9 @@ +public class Figure { + + int position; + + public Figure() { + this.position = -1; + } + +} diff --git a/src/main/java/Player.java b/src/main/java/Player.java index bd5496c..5e5d9a9 100644 --- a/src/main/java/Player.java +++ b/src/main/java/Player.java @@ -1,9 +1,17 @@ +import javax.sound.midi.Soundbank; +import java.util.Arrays; + public class Player { String name; + Figure[] figures; public Player (String name) { this.name = name; + figures = new Figure[4]; + for(int i = 0; i < 4; i++) { + this.figures[i] = new Figure(); + } } @Override diff --git a/src/test/java/PlayerTest.java b/src/test/java/PlayerTest.java index 86faf07..5000e0b 100644 --- a/src/test/java/PlayerTest.java +++ b/src/test/java/PlayerTest.java @@ -29,5 +29,18 @@ public class PlayerTest { assertThat(calculatedResult).describedAs("Player Name").isEqualTo(expectedResult); } + @Test + void checkStartPositionOfFigures() { + int expectedResult = -1; + int calculatedResult = p.figures[0].position; + for(int i = 0; i < 4; i++) { + calculatedResult = p.figures[i].position; + if(expectedResult != calculatedResult) { + calculatedResult = 1; + break; + } + } + assertThat(calculatedResult).describedAs("Starting postion of Figures").isEqualTo(expectedResult); + } }