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

            //act
            shape.MoveLeft();

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

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

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

            //act
            shape.MoveLeft();
            shape.MoveLeft();
            shape.MoveLeft();
            shape.MoveLeft();
            shape.MoveLeft();

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