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