public bool Rotate() { if (_movingShape == null) { return(true); } return(MoveShapeIfPossible(_movingShape.Rotate())); }
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); }