Beispiel #1
0
        public void CannotUseLocationWithWrongNumberOfDimensions(int[] location)
        {
            var sides = 4;

            var board = new GameBoard2d(new[] { 10, 10 }, sides);

            Assert.ThrowsException <ArgumentOutOfRangeException>(() => board.GetAdjacentLocations(location));
        }
Beispiel #2
0
        public void GetAdjacentLocations(int[] dimensions, int[] location, int expected)
        {
            var gameBoard = new GameBoard2d(dimensions, 4);

            var adjacentLocations = gameBoard.GetAdjacentLocations(location);

            Assert.AreEqual(expected, adjacentLocations.Count());
        }