public MainWindow() { currentBoard = new RealGameOfLife(3); currentBoard.Pattern_Selector("toad"); dispatcherTimer = new DispatcherTimer(); InitializeComponent(); TheListView.ItemsSource = currentBoard.ToList(); dispatcherTimer.Tick += dispatcherTimerClick; dispatcherTimer.Interval = TimeSpan.FromSeconds((double)RunSpeed.Value); }
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); }
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); }
public static void Throws_Error_On_Dumb_Input() { RealGameOfLife game = new RealGameOfLife(1); game.Pattern_Selector("nemo"); //ExceptionAssert.Throws<ArgumentException>(() => game.Pattern_Selector("nemo"); }