Ejemplo n.º 1
0
        public void GameOver_WhenPlaceBlockOnTop()
        {
            var game   = new GameModel(new Size(10, 20));
            var figure = Tetromino.CreateFigure(FigureType.O, new Vector(0, -Block.Size * 2));

            game.StartGame();
            game.AddToGameField(figure);
            Assert.AreEqual(game.GameIsOver, true);
        }
Ejemplo n.º 2
0
        public void GameGetBlockFromField_WorksCorrect()
        {
            var game   = new GameModel(new Size(10, 20));
            var figure = Tetromino.CreateFigure(FigureType.O, new Vector(0, Block.Size * 2));

            game.StartGame();
            game.AddToGameField(figure);
            var blockFromField = game.GetBlocksFromField();

            foreach (var block in figure.Blocks)
            {
                Assert.AreEqual(blockFromField.Contains(block), true);
            }
        }