public void ParseKingside()
        {
            var parser = new AlgebraicNotation();
            var moveRecord = "O-O";
            ChessMove move = parser.Parse(moveRecord);

            Assert.IsTrue(move.CastlingKingside);
        }
        public void ParseFigure()
        {
            var parser = new AlgebraicNotation();
            var moveRecord = "Ka4";
            ChessMove move = parser.Parse(moveRecord);

            Assert.AreEqual(PieceTypes.King, move.PieceType);
        }
        public void ParseLight()
        {
            var parser = new AlgebraicNotation();
            var moveRecord = "a4";
            ChessMove move = parser.Parse(moveRecord);

            Assert.AreEqual(null, move.From.File);
            Assert.AreEqual(null, move.From.Rank);
        }
        public void ParseFromRank()
        {
            var parser = new AlgebraicNotation();
            var moveRecord = "3a4";
            ChessMove move = parser.Parse(moveRecord);

            Assert.AreEqual(3, move.From.Rank);
            Assert.AreEqual(1, move.To.File);
            Assert.AreEqual(4, move.To.Rank);
        }
        public void ParseNoCastling()
        {
            var parser = new AlgebraicNotation();
            var moveRecord = "e2e4";
            ChessMove move = parser.Parse(moveRecord);

            Assert.IsFalse(move.CastlingKingside);
            Assert.IsFalse(move.CastlingQueenside);
        }
 public void ParseError()
 {
     var parser = new AlgebraicNotation();
     var moveRecord = "z4";
     ChessMove move = parser.Parse(moveRecord);
 }
        public void ParsePromotion2()
        {
            var parser = new AlgebraicNotation();
            var moveRecord = "a8=Q";
            ChessMove move = parser.Parse(moveRecord);

            Assert.IsTrue(move.IsPromotion);
            Assert.AreEqual(PieceTypes.Queen, move.PromotionTo);
        }
Beispiel #8
0
 public void ParseSANSingleMove()
 {
     var move = new AlgebraicNotation().Parse("e2e4");
     Assert.AreEqual("e2e4", move.ToString());
 }