public void TestGameFieldInitialization() { ICellFactory factory = new GridCellFactory(4, 4); IPlayField playField = new GridPlayField(factory, 4, 4); IGameRule rule = new ClassicRule(); var controller = new GameController(playField, rule); string state = "0100111011001010"; controller.SetState(state); Assert.AreEqual(controller.GetState(), state); }
public void TestNextGeneration() { ICellFactory factory = new GridCellFactory(4, 4); IPlayField playField = new GridPlayField(factory, 4, 4); IGameRule rule = new ClassicRule(); var controller = new GameController(playField, rule); const string state = "0100010001000000"; // blinker const string nextState = "0000111000000000"; controller.SetState(state); controller.MoveToNextGeneration(); Assert.AreEqual(nextState, controller.GetState()); }