public void Should_Test_UnderpopulationRule_Returns_False() { // arrange var fileInput = new FileReader(); var grid = new Universe(fileInput); var rule = new UnderpopulationRule(grid); grid.SetUpGrid(Constants.GridLength, Constants.GridWidth); grid.Initialise(); var col = 1; var row = 1; var expected = false; // act var result = rule.Check(row, col); // assert Assert.Equal(expected, result); }
public void Should_Test_UnderpopulationRule(int cellX, int cellY, bool expected) { // arrange var fileInput = new FileReader(); var grid = new Universe(fileInput); var rule = new UnderpopulationRule(grid); grid.SetUpGrid(Constants.GridLength, Constants.GridWidth); grid.Initialise(); grid.SwitchCellState(0, 0); grid.SwitchCellState(0, 1); grid.SwitchCellState(0, 2); grid.SwitchCellState(1, 0); grid.SwitchCellState(1, 2); grid.SwitchCellState(2, 0); grid.SwitchCellState(2, 1); // act var result = rule.Check(cellX, cellY); // assert Assert.Equal(expected, result); }