public void ShouldThrowIfPlayIsCalledBeforeBoardCreated() { gameOfLifeRuleMock.Setup(x => x.LifeStatusForNextTick(It.IsAny <DeadOrAliveNeighboursCount>(), It.IsAny <LifeStatus>())).Returns(LifeStatus.Alive); var gol = new GameOfLifeBoard(gameOfLifeRuleMock.Object); Assert.Throws <BoardNotCreatedException>(() => gol.PlayGame(1, It.IsAny <Action <LifeStatus[, ]> >())); }
private static void SetupAndPlayGameOfLife(GameOfLifeBoard gol, int rows, int columns, int tickGenerations, List <RowColumnLifeStatus> seedList) { var boardVisualizer = new ConsoleBoardOutput(); gol.CreateNewBoard(rows, columns); if (seedList.Any()) { gol.Seed(seedList); } gol.PlayGame(tickGenerations, boardVisualizer.Output); }