public void RotateHeadToTheLeftDenyBecauseDirectionLeftIsLimitedTest() { //Arrange creator = new MockCreatorRobot(); MockRobot robot = ((MockRobot)creator .MakeARobot()) .WithHeadDirectionToLeftIsLimited(); //Action var result = robot.RotateHeadToTheLeft(); //Assert result.IsFailure.ShouldBeTrue(); result.Failure.ShouldBeOfType <LimitedHeadRotateException>(); robot.HeadDirection.ShouldBe(90); }
public void RotateHeadToTheLeftDenyBecauseAlignIsBottonTest() { //Arrange creator = new MockCreatorRobot(); MockRobot robot = ((MockRobot)creator .MakeARobot()) .WithHeadToBelow(); //Action var result = robot.RotateHeadToTheLeft(); //Assert result.IsFailure.ShouldBeTrue(); result.Failure.ShouldBeOfType <DeniedHeadRotateException>(); robot.HeadDirection.ShouldBe(0); robot.RaisedEvents().ShouldHaveSingleItem(); }