Пример #1
0
        public void AvailableMovesTest_2(
            sbyte directionRight1,
            sbyte directionDown1,
            sbyte directionRight2,
            sbyte directionDown2,
            bool isCapture,
            byte x0,
            byte y0,
            byte x11,
            byte y11,
            byte x12,
            byte y12)
        {
            var availableMoves = new AvailableMoves();

            availableMoves.AddDirection(directionRight1, directionDown1, isCapture);
            availableMoves.AddDirection(directionRight2, directionDown2, isCapture);

            var cells = availableMoves.ToCells(x0, y0);

            cells[0].X.Should().Be(x11);
            cells[0].Y.Should().Be(y11);

            cells[1].X.Should().Be(x12);
            cells[1].Y.Should().Be(y12);

            cells[2].Should().Be(_emptyCell);
            cells[3].Should().Be(_emptyCell);
        }
Пример #2
0
        public void AvailableMovesTest_4()
        {
            var availableMoves = new AvailableMoves();

            availableMoves.AddDirection(-1, 1, false);
            availableMoves.AddDirection(-1, 1, true);

            var cells = availableMoves.ToCells(7, 5);

            cells[0].X.Should().Be(5);
            cells[0].Y.Should().Be(7);

            cells[1].Should().Be(_emptyCell);
            cells[2].Should().Be(_emptyCell);
            cells[3].Should().Be(_emptyCell);
        }