Browse Source

Coodrdinates returns correct Values for X and Y

fleetstorm
Max Wenzel 3 years ago
committed by Lorenz Hohmann
parent
commit
b696244000
  1. 20
      src/main/java/de/tims/fleetstorm/matchfield/Coordinate.java
  2. 20
      src/test/java/de/tims/fleetstorm/matchfield/CoordinateTest.java
  3. 2
      src/test/java/de/tims/fleetstorm/matchfield/MatchfieldCreationTest.java

20
src/main/java/de/tims/fleetstorm/matchfield/Coordinate.java

@ -0,0 +1,20 @@
package de.tims.fleetstorm.matchfield;
public class Coordinate {
private int x;
private int y;
public Coordinate(int x, int y) {
this.x = x;
this.y = y;
}
public Integer getX() {
return x;
}
public Integer getY() {
return y;
}
}

20
src/test/java/de/tims/fleetstorm/matchfield/CoordinateTest.java

@ -0,0 +1,20 @@
package de.tims.fleetstorm.matchfield;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
class CoordinateTest {
int x = 1;
int y = 3;
Coordinate coordinate = new Coordinate(x, y);
@Test
void testGetCorrectValuesForXY() {
assertEquals(coordinate.getX(), x);
assertEquals(coordinate.getY(), y);
}
}

2
src/test/java/de/tims/fleetstorm/matchfield/MatchfieldCreationTest.java

@ -1,7 +1,7 @@
package de.tims.fleetstorm.matchfield; package de.tims.fleetstorm.matchfield;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.util.stream.Stream; import java.util.stream.Stream;

Loading…
Cancel
Save