You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
915 B

package de.fd.fh;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class FigureBishopTest
{
Figure[] field = new Figure[Figure.fieldLength * Figure.fieldLength];
@Test
void checkInvalidMovesBishopUpward()
{
Figure f = new FigureBishop();
int src = Figure.fieldLength * 5 + 5;
int dst = src - Figure.fieldLength;
assertFalse(f.moveAllowed(src, dst, field));
}
@Test
void checkInvalidMovesBishopRight()
{
Figure f = new FigureBishop();
int src = Figure.fieldLength * 5 + 5;
int dst = src + 1;
assertFalse(f.moveAllowed(src, dst, field));
}
@Test
void checkInvalidMovesBishopRight2()
{
Figure f = new FigureBishop();
int src = Figure.fieldLength * 5 + 5;
int dst = src + 6;
assertFalse(f.moveAllowed(src, dst, field));
}
}