Esempio n. 1
0
        public void FillUpBoard_ShouldFillUpAllRemainingFieldOnTheBoardAfterSpecifiedFieldsHaveTaken()
        {
            //Arrange
            var testDirection = Direction.NorthDirection;
            var testTile      = new Tile(0, 1);
            var testTurtle    = new Turtle(testTile, testDirection);
            var tiles         = new Tile[3, 2];
            var mines         = new Mine[] { new Mine(1, 1), new Mine(1, 0) };

            minefield = new Minefield(mockedMovementFactory.Object, tiles, mines, new ExitPoint(0, 0), testTurtle);

            //Act
            minefield.FillUpBoard();

            //Assert
            Assert.That(tiles[2, 0] != null);
            Assert.That(tiles[2, 1] != null);
            Assert.That(tiles[1, 1] != null);
            Assert.That(tiles[1, 0] != null);
            Assert.That(tiles[0, 1] != null);
            Assert.That(tiles[0, 0] != null);
        }
Esempio n. 2
0
        public void FillUpBoard_ShouldFillUpMinesToBoardAndTakeTheExitPoint()
        {
            //Arrange
            var testDirection = Direction.NorthDirection;
            var testTile      = new Tile(0, 1);
            var testTurtle    = new Turtle(testTile, testDirection);
            var tiles         = new Tile[2, 2];

            tiles[0, 1] = testTile;
            var mines = new Mine[] { new Mine(1, 1), new Mine(1, 0) };

            minefield = new Minefield(mockedMovementFactory.Object, tiles, mines, new ExitPoint(0, 0), testTurtle);

            //Act
            minefield.FillUpBoard();

            //Assert
            Assert.That(tiles[1, 1] is Mine);
            Assert.That(tiles[1, 0] is Mine);
            Assert.That(tiles[0, 1] is Mine == false);
            Assert.That(tiles[0, 0] is ExitPoint);
        }