Example #1
0
        public void TestMethodShapeL_Drop()
        {
            //arrange
            IBoard board = new Board();
            ShapeL shape = new ShapeL(board);

            //act
            shape.Drop();

            //assert
            Assert.AreEqual(4, shape[0].Position.X);
            Assert.AreEqual(19, shape[0].Position.Y);
            Assert.AreEqual(4, shape[1].Position.X);
            Assert.AreEqual(18, shape[1].Position.Y);
            Assert.AreEqual(5, shape[2].Position.X);
            Assert.AreEqual(18, shape[2].Position.Y);
            Assert.AreEqual(6, shape[3].Position.X);
            Assert.AreEqual(18, shape[3].Position.Y);
        }
Example #2
0
        public void TestShapeL_DownRotateDrop()
        {
            //arrange
            IBoard board = new Board();
            ShapeL shape = new ShapeL(board);

            //act
            shape.MoveDown();
            shape.Rotate();
            shape.Drop();

            //assert
            Assert.AreEqual(new Point(6, 19), shape[0].Position);
            Assert.AreEqual(new Point(5, 19), shape[1].Position);
            Assert.AreEqual(new Point(5, 18), shape[2].Position);
            Assert.AreEqual(new Point(5, 17), shape[3].Position);
        }