Example #1
0
        public void CountsTwoLiveNeighborsFor_0x0_In_2x2_Grid()
        {
            var seed = new StringBuilder();

            seed.AppendLine("-1");
            seed.AppendLine("1-");
            var board = new GameBoard(seed.ToString());

            board.CountLiveNeighborsForCellPosition(0, 0).Should().Be(2);
        }
Example #2
0
        public void CountsOneLiveNeighborsFor_1x1_In_2x2_Grid()
        {
            var seed = new StringBuilder();

            seed.AppendLine("1-");
            seed.AppendLine("--");
            var board = new GameBoard(seed.ToString());

            board.CountLiveNeighborsForCellPosition(1, 1).Should().Be(1);
        }
Example #3
0
        public void CountsNoLiveNeighborsFor_0x0_In_1x1_Grid()
        {
            var board = new GameBoard("-");

            board.CountLiveNeighborsForCellPosition(0, 0).Should().Be(0);
        }