Browse Source

refactored test whiteFarmerInvalidDestinationDown to ParameterizedTest

feat-figureMovement
JD 4 years ago
parent
commit
edbd9c568c
  1. 13
      fh.fd.ci.client/src/test/java/de/fd/fh/FigureFarmerTest.java

13
fh.fd.ci.client/src/test/java/de/fd/fh/FigureFarmerTest.java

@ -25,11 +25,16 @@ class FigureFarmerTest
assertTrue(f.moveAllowed(src, dst, field)); assertTrue(f.moveAllowed(src, dst, field));
} }
@Test
void whiteFarmerInvalidDestinationDown() // statt nach "oben" wird nach "unten" gegangen
// weißer Bauer
@ParameterizedTest
// row (src), col (src), row (dst), col (dst)
@CsvSource({
"6, 0, 7, 0" // a2 -> a1
})
void whiteFarmerInvalidDestinationDown(int srcRow, int srcCol, int dstRow, int dstCol) // statt nach "oben" wird nach "unten" gegangen
{ {
int src = Figure.fieldLength * 6 + 0;
int dst = Figure.fieldLength * 7 + 0;
int src = Figure.fieldLength * srcRow + srcCol;
int dst = Figure.fieldLength * dstRow + dstCol;
Figure f = new FigureFarmer(FigureFarmer.Color.White); Figure f = new FigureFarmer(FigureFarmer.Color.White);
assertFalse(f.moveAllowed(src, dst, field)); assertFalse(f.moveAllowed(src, dst, field));

Loading…
Cancel
Save