Ejemplo n.º 1
0
        public void FindUpRigthNeighbourShouldThrowIndexOutOfRangeException()
        {
            // Arrange
            var grid = MockGrid.Context();

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

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

            // Assert
            action
            .Should()
            .Throw <IndexOutOfRangeException>();
        }
Ejemplo n.º 2
0
        public void FindUpRigthNeighbourShouldReturnRigthCell()
        {
            // Arrange
            var grid = MockGrid.Context();

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

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

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