public void CyclicSetUpShouldBeTheSameAfter3Periods() { var input = "...............\n" + "...***...***...\n" + "...............\n" + ".*....*.*....*.\n" + ".*....*.*....*.\n" + ".*....*.*....*.\n" + "...***...***...\n" + "...............\n" + "...***...***...\n" + ".*....*.*....*.\n" + ".*....*.*....*.\n" + ".*....*.*....*.\n" + "...............\n" + "...***...***...\n" + "..............."; var gol = new GameOfLife(input); gol.NextStep(); gol.NextStep(); gol.NextStep(); Assert.AreEqual(input, gol.CurrentState); }
public void BlinkerExample() { var input = "...\n" + "***\n" + "..."; var gol = new GameOfLife(input); gol.NextStep(); var expectedOutput = ".*.\n" + ".*.\n" + ".*."; Assert.AreEqual(expectedOutput, gol.CurrentState); }
public void BeaconExample() { var input = "**..\n" + "**..\n" + "..**\n" + "..**"; var gol = new GameOfLife(input); gol.NextStep(); var expectedOutput = "**..\n" + "*...\n" + "...*\n" + "..**"; Assert.AreEqual(expectedOutput, gol.CurrentState); }
public void StaticLoafExample() { var input = ".**.\n" + "*..*\n" + ".*.*\n" + "..*."; var gol = new GameOfLife(input); gol.NextStep(); var expectedOutput = ".**.\n" + "*..*\n" + ".*.*\n" + "..*."; Assert.AreEqual(expectedOutput, gol.CurrentState); }