Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        public bool BuildNewBoard(GameBoard board)
        {
            var size = view.GetBoardSize();

            if (size == 0)
            {
                return(false);
            }

            board.BoardSize       = size;
            board.GenerationCount = view.GetGenerationCount();
            return(true);
        }