예제 #1
0
        public void FindUpNeighbourShouldThrowIndexOutOfRangeException()
        {
            // Arrange
            var grid = MockGrid.Context();

            var gridService = new GridService(grid);
            var testedCellY = 0;
            var testedCellX = 1;

            // Act
            Action action = () => gridService.FindUpNeighbour(testedCellY, testedCellX);

            // Assert
            action
            .Should()
            .Throw <IndexOutOfRangeException>();
        }
예제 #2
0
        public void FindUpNeighbourShouldReturnRigthCell()
        {
            // Arrange
            var grid = MockGrid.Context();

            var gridService = new GridService(grid);
            var testedCellY = 1;
            var testedCellX = 1;

            // Act
            var result = gridService.FindUpNeighbour(testedCellY, testedCellX);

            // Assert
            result
            .Should()
            .BeEquivalentTo <Cell>(grid[0][1]);
        }