public void FindDownLeftNeighbourThrowIndexOutOfRangeException() { // Arrange var grid = MockGrid.Context(); var gridService = new GridService(grid); var testedCellY = 3; var testedCellX = 0; // Act Action action = () => gridService.FindDownLeftNeighbour(testedCellY, testedCellX); // Assert action .Should() .Throw <IndexOutOfRangeException>(); }
public void FindDownLeftNeighbourShouldReturnRigthCell() { // Arrange var grid = MockGrid.Context(); var gridService = new GridService(grid); var testedCellY = 1; var testedCellX = 1; // Act var result = gridService.FindDownLeftNeighbour(testedCellY, testedCellX); // Assert result .Should() .BeEquivalentTo <Cell>(grid[2][0]); }