Пример #1
0
 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));
 }
Пример #2
0
 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));
 }
Пример #3
0
 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));
 }
Пример #4
0
 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));
 }