Esempio n. 1
0
        public void ShouldInitBlinkerObject()
        {
            //Given
            Board      board   = new Board(5, 5, new ConwaysRule());
            IGoLObject blinker = GoLObjectFactory.Create(GoLPatterns.Blinker);
            GoLHelper  helper  = new GoLHelper(5, 5);

            //When
            blinker.Fill(board, 1, 2);
            //Then
            board.Table.ShouldBe(helper.CreateBlinkerFirstState(1, 2));
        }
Esempio n. 2
0
        public void BlinkerAfter2GenerationShouldReturnToInitState()
        {
            //Given
            Board      board   = new Board(5, 5, new ConwaysRule());
            IGoLObject blinker = GoLObjectFactory.Create(GoLPatterns.Blinker);
            GoLHelper  helper  = new GoLHelper(5, 5);

            //When
            blinker.Fill(board, 1, 2);
            board.NextGeneration();
            board.NextGeneration();
            //Then
            board.Table.ShouldBe(helper.CreateBlinkerFirstState(1, 2));
        }