コード例 #1
0
 public void CoordinateToIdOn4x4Board(int x, int y, int n)
 {
     // |_|1|_|2|
     // |3|_|4|_|
     // |_|5|_|6|
     // |7|_|8|_|
     SquareId.FromPosition(x, y, 4).Should().Be(new SquareId(n));
 }
コード例 #2
0
        public void NonPlayableCoordinatesShouldThrow()
        {
            // |_|.|_|.|
            // |.|x|.|_|
            // |_|.|_|.|
            // |.|_|.|_|
            Action fromPosition = () => SquareId.FromPosition(1, 1, 4);

            fromPosition.Should().Throw <ManualValidationException>();
        }
コード例 #3
0
 public void CoordinateToIdOn8x8Board(int x, int y, int n)
 {
     SquareId.FromPosition(x, y, 8).Should().Be(new SquareId(n));
 }
コード例 #4
0
 private SquareId Pos(int x, int y) => SquareId.FromPosition(x, y, 4);