Пример #1
0
        public void TestMethodShapeO_MoveLeft()
        {
            //arrange
            IBoard board = new Board();
            ShapeO shape = new ShapeO(board);

            //act
            shape.MoveLeft();

            //assert
            Assert.AreEqual(3, shape[0].Position.X);
            Assert.AreEqual(0, shape[0].Position.Y);
            Assert.AreEqual(3, shape[1].Position.X);
            Assert.AreEqual(1, shape[1].Position.Y);
            Assert.AreEqual(4, shape[2].Position.X);
            Assert.AreEqual(0, shape[2].Position.Y);
            Assert.AreEqual(4, shape[3].Position.X);
            Assert.AreEqual(1, shape[3].Position.Y);
        }
Пример #2
0
        public void TestShapeO_DownRotateRight()
        {
            //arrange
            IBoard board = new Board();
            ShapeO shape = new ShapeO(board);

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

            //assert
            Assert.AreEqual(new Point(3, 1), shape[0].Position);
            Assert.AreEqual(new Point(3, 2), shape[1].Position);
            Assert.AreEqual(new Point(4, 1), shape[2].Position);
            Assert.AreEqual(new Point(4, 2), shape[3].Position);
        }
Пример #3
0
        public void TestShapeO_AllLeft()
        {
            //arrange
            IBoard board = new Board();
            ShapeO shape = new ShapeO(board);

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

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