Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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();
        }