コード例 #1
0
ファイル: ShapeOTest.cs プロジェクト: jeegnathebug/Tetris
        public void TestMethodShapeO_MoveDown()
        {
            //arrange
            IBoard board = new Board();
            ShapeO shape = new ShapeO(board);

            //act
            shape.MoveDown();

            //assert
            Assert.AreEqual(4, shape[0].Position.X);
            Assert.AreEqual(1, shape[0].Position.Y);
            Assert.AreEqual(4, shape[1].Position.X);
            Assert.AreEqual(2, shape[1].Position.Y);
            Assert.AreEqual(5, shape[2].Position.X);
            Assert.AreEqual(1, shape[2].Position.Y);
            Assert.AreEqual(5, shape[3].Position.X);
            Assert.AreEqual(2, shape[3].Position.Y);
        }
コード例 #2
0
ファイル: ShapeOTest.cs プロジェクト: jeegnathebug/Tetris
        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
ファイル: ShapeOTest.cs プロジェクト: jeegnathebug/Tetris
        public void TestShapeO_DownRotateDrop()
        {
            //arrange
            IBoard board = new Board();
            ShapeO shape = new ShapeO(board);

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

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