public GameOfLife() { IEnumerable <Cell> pattern = new RlePattern(Patterns.AlternateWichStrecher1); pattern = PatternUtils.OriginToCenter(pattern); _field = new HashSet <Cell>(pattern); _runner = new LifeRunner(_field); }
public void AliveCellsData_ShouldHaveProperLocation(string data, int x, int y) { var pattern = new RlePattern(data); Assert.Equal(new Cell(x, y), pattern.Last()); }
public void AliveCellsData_ShouldNotBeEmpty(string data) { var pattern = new RlePattern(data); Assert.NotEmpty(pattern); }
public void AliveCellsData_ShouldHaveProperCount(string data, int count) { var pattern = new RlePattern(data); Assert.Equal(count, pattern.Count()); }
public void BlankCellsData_ShouldBeEmpty(string data) { var pattern = new RlePattern(data); Assert.Empty(pattern); }