public void LifeCycleCycleTestBlinker() { List<Cell> blinkerTextCellsVertical = new List<Cell>(); blinkerTextCellsVertical.Add(new Cell(2, 1)); blinkerTextCellsVertical.Add(new Cell(2, 2)); blinkerTextCellsVertical.Add(new Cell(2, 3)); LifeCycle lifeCycle = new LifeCycle(blinkerTextCellsVertical); lifeCycle.Cycle(); Assert.IsTrue(lifeCycle.checkCellCollectionForCell(lifeCycle.Cells, new Cell(1, 2))); Assert.IsTrue(lifeCycle.checkCellCollectionForCell(lifeCycle.Cells, new Cell(2, 2))); Assert.IsTrue(lifeCycle.checkCellCollectionForCell(lifeCycle.Cells, new Cell(3, 2))); Assert.IsFalse(lifeCycle.checkCellCollectionForCell(lifeCycle.Cells, new Cell(2, 3))); Assert.IsTrue(lifeCycle.Cells.Count == 3); lifeCycle.Cycle(); Assert.IsTrue(lifeCycle.checkCellCollectionForCell(lifeCycle.Cells, new Cell(2, 1))); Assert.IsTrue(lifeCycle.checkCellCollectionForCell(lifeCycle.Cells, new Cell(2, 2))); Assert.IsTrue(lifeCycle.checkCellCollectionForCell(lifeCycle.Cells, new Cell(2, 3))); Assert.IsFalse(lifeCycle.checkCellCollectionForCell(lifeCycle.Cells, new Cell(1, 2))); Assert.IsTrue(lifeCycle.Cells.Count == 3); }
public void LifeCycleCycleTestBlock() { List<Cell> blockTestCells = new List<Cell>(); blockTestCells.Add(new Cell(7, 5)); blockTestCells.Add(new Cell(8, 5)); blockTestCells.Add(new Cell(7, 6)); blockTestCells.Add(new Cell(8, 6)); LifeCycle lifeCycle = new LifeCycle(blockTestCells); for (var counter = 0; counter < 4; counter++) { lifeCycle.Cycle(); Assert.IsTrue(lifeCycle.checkCellCollectionForCell(lifeCycle.Cells, new Cell(7, 5))); Assert.IsTrue(lifeCycle.checkCellCollectionForCell(lifeCycle.Cells, new Cell(8, 5))); Assert.IsTrue(lifeCycle.checkCellCollectionForCell(lifeCycle.Cells, new Cell(7, 6))); Assert.IsTrue(lifeCycle.checkCellCollectionForCell(lifeCycle.Cells, new Cell(8, 6))); Assert.IsFalse(lifeCycle.checkCellCollectionForCell(lifeCycle.Cells, new Cell(2, 3))); Assert.IsTrue(lifeCycle.Cells.Count == 4); } }