Ejemplo n.º 1
0
 public void Can_Create_Blinker_Pattern()
 {
     RealGameOfLife ExpectedGame = new RealGameOfLife(1);
     ExpectedGame.Pattern_Selector("Blinker");
     RealGameOfLife ActualGame = new RealGameOfLife(5);
     ActualGame.Flipper(1, 2);
     ActualGame.Flipper(2, 2);
     ActualGame.Flipper(3, 2);
     var expected = ExpectedGame.GetBoard();
     var actual = ActualGame.GetBoard();
     CollectionAssert.AreEqual(expected, actual);
 }
Ejemplo n.º 2
0
 public void Can_Create_Beacon_Pattern()
 {
     RealGameOfLife ExpectedGame = new RealGameOfLife(1);
     ExpectedGame.Pattern_Selector("beacon");
     RealGameOfLife ActualGame = new RealGameOfLife(6);
     ActualGame.Flipper(1, 1);
     ActualGame.Flipper(1, 2);
     ActualGame.Flipper(2, 1);
     ActualGame.Flipper(3, 4);
     ActualGame.Flipper(4, 3);
     ActualGame.Flipper(4, 4);
     var expected = ExpectedGame.GetBoard();
     var actual = ActualGame.GetBoard();
     CollectionAssert.AreEqual(expected, actual);
 }
Ejemplo n.º 3
0
 public void TickOnThreeByThree()
 {
     RealGameOfLife game = new RealGameOfLife(3);
     game.Flipper(1, 0);
     game.Flipper(1, 1);
     game.Flipper(1, 2);
     game.Tick();
     RealGameOfLife game2 = new RealGameOfLife(3);
     game2.Flipper(0, 1);
     game2.Flipper(1, 1);
     game2.Flipper(2, 1);
     var first = game.GetBoard();
     var second = game2.GetBoard();
     CollectionAssert.AreEqual(first, second);
 }