public void Start_Success() { A.CallTo(() => fakeView.GetBoardSize()).ReturnsNextFromSequence(10, 20, 0); A.CallTo(() => fakeView.GetGenerationCount()).ReturnsNextFromSequence(111, 222); controller.Start(); A.CallTo(() => fakeView.PrepareWindow(A <int> .Ignored)).MustHaveHappenedTwiceExactly(); A.CallTo(() => fakeView.ShowResult(A <bool[][]> .Ignored)).MustHaveHappenedANumberOfTimesMatching(x => x == 333); A.CallTo(() => fakeView.Wait(A <int> .Ignored)).MustHaveHappenedANumberOfTimesMatching(x => x == 333); A.CallTo(() => fakeView.Pause()).MustHaveHappenedTwiceExactly(); A.CallTo(() => fakeView.Close()).MustHaveHappenedOnceExactly(); }
public void Start() { while (BuildNewBoard(Board)) { if (Board.HasValidSize) { Board.ResetStartingPattern(); view.PrepareWindow(Board.BoardSize); do { view.ShowResult(Board.Cells.Grid); view.Wait(100); }while (Board.GenerateNext(view.HasUserInterrupted)); view.Pause(); } } view.Close(); }