|
|
@ -1,6 +1,8 @@ |
|
|
|
package de.fd.fh; |
|
|
|
|
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
import org.junit.jupiter.params.ParameterizedTest; |
|
|
|
import org.junit.jupiter.params.provider.CsvSource; |
|
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.*; |
|
|
|
|
|
|
@ -9,11 +11,15 @@ class FigureFarmerTest |
|
|
|
Figure[] field = new Figure[Figure.fieldLength * Figure.fieldLength]; |
|
|
|
|
|
|
|
// weißer Bauer |
|
|
|
@Test |
|
|
|
void whiteFarmerValidDestination() |
|
|
|
@ParameterizedTest |
|
|
|
// row (src), col (src), row (dst), col (dst) |
|
|
|
@CsvSource({ |
|
|
|
"6, 0, 5, 0" // a2 -> a3 |
|
|
|
}) |
|
|
|
void whiteFarmerValidDestination(int srcRow, int srcCol, int dstRow, int dstCol) |
|
|
|
{ |
|
|
|
int src = Figure.fieldLength * 6 + 0; |
|
|
|
int dst = Figure.fieldLength * 5 + 0; |
|
|
|
int src = Figure.fieldLength * srcRow + srcCol; |
|
|
|
int dst = Figure.fieldLength * dstRow + dstCol; |
|
|
|
|
|
|
|
Figure f = new FigureFarmer(FigureFarmer.Color.White); |
|
|
|
assertTrue(f.moveAllowed(src, dst, field)); |
|
|
|