Exemplo n.º 1
0
 public void GetNextCellIndexThrowsOnFullColumn()
 {
     var gameLogic = new GameLogic();
     var game = new Game();
     game.Cells = new int[,]
     {
         { 2, 0, 0, 0 },
         { 1, 0, 0, 0 },
         { 2, 0, 0, 0 },
         { 1, 0, 0, 0 },
     };
     gameLogic.GetNextCellIndex(game, 0);
 }
Exemplo n.º 2
0
        public void GetNextCellIndexReturnsExpectedValue()
        {
            var gameLogic = new GameLogic();
            var game = new Game();
            game.Cells = new int[,]
            {
                { 1, 0, 0, 0 },
                { 1, 0, 0, 0 },
                { 1, 0, 0, 0 },
                { 1, 0, 0, 0 },
            };
            var column = 0;

            // clear cells starting with top one and check that GetNextCellIndex returns just-cleared row value
            for (var row = 0; row < game.MaxRows; row += 1)
            {
                game.Cells[row, column] = 0;

                Assert.AreEqual(row, gameLogic.GetNextCellIndex(game, column));
            }
        }