public void TryParse_Valid_QueenToPosition(string message, BoardFile toFile, BoardRank toRank) { var target = new MovePromotionParser(); var parsed = target.TryParse(message, out var promotion); Assert.IsTrue(parsed); Assert.IsNull(promotion.FromFile); Assert.IsNull(promotion.FromRank); Assert.IsFalse(promotion.Captures); Assert.AreEqual(toFile, promotion.ToFile); Assert.AreEqual(toRank, promotion.ToRank); Assert.AreEqual(Piece.Queen, promotion.PromotionToPiece); Assert.IsFalse(promotion.Check); Assert.IsFalse(promotion.Checkmate); }
public void TryParse_Valid_ToPosition(string message, BoardFile toFile, BoardRank toRank) { var target = new MovePieceParser(); var parsed = target.TryParse(message, out var pieceDto); Assert.IsTrue(parsed); Assert.AreEqual(Piece.Empty, pieceDto.Piece); Assert.IsNull(pieceDto.FromFile); Assert.IsNull(pieceDto.FromRank); Assert.IsFalse(pieceDto.Captures); Assert.AreEqual(toFile, pieceDto.ToFile); Assert.AreEqual(toRank, pieceDto.ToRank); Assert.IsFalse(pieceDto.Check); Assert.IsFalse(pieceDto.Checkmate); }