|
@ -1,6 +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.jupiter.api.Assertions.assertEquals; |
|
|
import static org.junit.jupiter.api.Assertions.assertNotNull; |
|
|
import static org.junit.jupiter.api.Assertions.assertNotNull; |
|
|
|
|
|
|
|
|
import java.util.stream.Stream; |
|
|
import java.util.stream.Stream; |
|
@ -127,4 +128,17 @@ class MatchfieldCreationTest { |
|
|
matchfield.getField(5, 4)), |
|
|
matchfield.getField(5, 4)), |
|
|
Arguments.of("below from (5/0) - should be null", matchfield, new Coordinate(5, 0), null)); |
|
|
Arguments.of("below from (5/0) - should be null", matchfield, new Coordinate(5, 0), null)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void testsetStateOverloaded() { |
|
|
|
|
|
|
|
|
|
|
|
Matchfield matchfield = new Matchfield(10); |
|
|
|
|
|
matchfield.createMatchfield(); |
|
|
|
|
|
int x = 3; |
|
|
|
|
|
int y = 3; |
|
|
|
|
|
matchfield.setState(new Coordinate(x, y), Coordinate.SHIP); |
|
|
|
|
|
int result = matchfield.getState(x, y); |
|
|
|
|
|
assertEquals(result, Coordinate.SHIP); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |