예제 #1
0
        public bool Rotate()
        {
            if (_movingShape == null)
            {
                return(true);
            }

            return(MoveShapeIfPossible(_movingShape.Rotate()));
        }
예제 #2
0
            public void WhenRotateIsCalledNRotatedShapeIsReturned()
            {
                var shapeMock    = new Mock <ITetrisShape>();
                var rotatedShape = new Mock <ITetrisShape>();

                shapeMock.Setup(p => p.Rotate()).Returns(rotatedShape.Object);

                var shape      = new PositionedShape(shapeMock.Object, Color.Red, new Point(0, 0));
                var movedShape = shape.Rotate();

                Assert.AreEqual(rotatedShape.Object, movedShape.Shape);
            }