public void ShouldParseFromFile(string notation, int file)
        {
            StandardAlgebraicNotation.Parse(notation);
            StandardAlgebraicNotation.TryParse(notation, out var an).ShouldBeTrue();

            an.FromFileX.HasValue.ShouldBeTrue();
            an.FromFileX.Value.ShouldBe(file);
        }
        public void ShouldParsePieceName(string notation, ChessPieceName piece)
        {
            StandardAlgebraicNotation.Parse(notation);

            StandardAlgebraicNotation.TryParse(notation, out var an).ShouldBeTrue();

            an.Piece.ShouldBe(piece);
        }
        public void ShouldDisambiguateRank(string move, string expected)
        {
            var san = StandardAlgebraicNotation.Parse(move);

            san.FromFileX.HasValue.ShouldBeFalse();
            san.FromRankY.HasValue.ShouldBeTrue();
            san.FromRankY.Value.ShouldBe(4);
        }
 public void Should_parse_san_notation(string san)
 {
     StandardAlgebraicNotation.Parse(san).ToNotation().ShouldBe(san);
 }
        public void ShouldFailParsing(string notation)
        {
            StandardAlgebraicNotation.TryParse(notation, out var an).ShouldBeFalse();

            Should.Throw <Exception>(() => StandardAlgebraicNotation.Parse(notation));
        }
Beispiel #6
0
 public static StandardAlgebraicNotation ToSan(this string s)
 {
     return(StandardAlgebraicNotation.Parse(s));
 }