Browse Source

test: bishop invalid step 3

feat-figureMovement
JD 4 years ago
parent
commit
9fc4119045
  1. 3
      fh.fd.ci.client/src/main/java/de/fd/fh/FigureBishop.java
  2. 8
      fh.fd.ci.client/src/test/java/de/fd/fh/FigureBishopTest.java

3
fh.fd.ci.client/src/main/java/de/fd/fh/FigureBishop.java

@ -10,7 +10,8 @@ public class FigureBishop extends Figure
return false; return false;
} }
if (dst - src == 1 || dst - src == 6) // 1 Feld nach rechts
if (dst - src == 1 || dst - src == 6
|| dst - src == 10) // 1 Feld nach rechts
{ {
return false; return false;
} }

8
fh.fd.ci.client/src/test/java/de/fd/fh/FigureBishopTest.java

@ -40,4 +40,12 @@ class FigureBishopTest
assertFalse(f.moveAllowed(src, dst, field)); assertFalse(f.moveAllowed(src, dst, field));
} }
@Test
void checkValidMovesBishopRight3()
{
Figure f = new FigureBishop();
assertFalse(f.moveAllowed(45, 55, field));
}
} }
Loading…
Cancel
Save