public void Should_Test_ReproductionRule(int cellX, int cellY, bool expected) { // arrange var fileInput = new FileReader(); var grid = new Universe(fileInput); var rule = new ReproductionRule(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, 1); grid.SwitchCellState(1, 2); // act var result = rule.Check(cellX, cellY); // assert Assert.Equal(expected, result); }
/* * PUBLIC MEMBER FUNCTIONS **/ public void addRule(ReproductionRule r) { rules.Add(r); }