public void KnightNot() { var from = new Position(3, 3); var s = new ChessState(); var m = new KnightMoveTemplate(); Assert.IsFalse(m.CanApply(from, new Position(2, 2), s)); }
public void KnightUpRight() { var from = new Position(3, 3); var s = new ChessState(); var m = new KnightMoveTemplate(); Assert.IsTrue(m.CanApply(from, new Position(4, 5), s)); Assert.IsTrue(m.CanApply(from, new Position(5, 4), s)); }
public void KnightDownLeft() { var from = new Position(3, 3); var s = new ChessState(); var m = new KnightMoveTemplate(); Assert.IsTrue(m.CanApply(from, new Position(2, 1), s)); Assert.IsTrue(m.CanApply(from, new Position(1, 2), s)); }
public void KnightCanSkip() { var from = new Position(3, 3); var s = new ChessState(); s[new Position(3, 4)] = new ChessPiece(); var m = new KnightMoveTemplate(); Assert.IsTrue(m.CanApply(from, new Position(4, 5), s)); }