public void RepositoryAddRobotTest() { //Arrange creator = new MockCreatorRobot(); RobotAgreggate robot = creator.MakeARobot(); //Action var result = repository.Add(robot); //Assert result.IsSuccess.ShouldBeTrue(); result.Success.RobotId.ShouldNotBeNullOrEmpty(); }
public void RotateRightWristToTheLeftDenyBecauseElbowIsntCollapsedTest() { //Arrange creator = new MockCreatorRobot(); MockRobot robot = ((MockRobot)creator.MakeARobot()); //Action var result = robot.RightWristRotateToTheLeft(); //Assert result.IsFailure.ShouldBeTrue(); result.Failure.ShouldBeOfType <DeniedWristRotateException>(); robot.RightWristDirection.ShouldBe(0); }
public void MoveHeadToBelowWhenAlignIsTopTest() { //Arrange creator = new MockCreatorRobot(); MockRobot robot = ((MockRobot)creator.MakeARobot()) .WithHeadForUp(); //Action var result = robot.MoveHeadToBelow(); //Assert result.IsSuccess.ShouldBeTrue(); result.Success.ShouldBe(Align.Normal); robot.HeadAlign.ShouldBe(Align.Normal); }
public void MoveHeadForUpDenyTest() { //Arrange creator = new MockCreatorRobot(); MockRobot robot = ((MockRobot)creator.MakeARobot()) .WithHeadForUp(); //Action var result = robot.MoveHeadForUp(); //Assert result.IsFailure.ShouldBeTrue(); result.Failure.ShouldBeOfType <LimitedHeadMoveException>(); robot.HeadAlign.ShouldBe(Align.Top); }
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 RotateRightWristToTheRightTest() { //Arrange creator = new MockCreatorRobot(); MockRobot robot = ((MockRobot)creator .MakeARobot()) .WithRightElbowCollapsed(); //Action var result = robot.RightWristRotateToTheRight(); //Assert result.IsSuccess.ShouldBeTrue(); result.Success.ShouldBe(-45); robot.RightWristDirection.ShouldBe(-45); }
public void CollapseLeftElbowDenyTest() { //Arrange creator = new MockCreatorRobot(); MockRobot robot = ((MockRobot)creator .MakeARobot()) .WithLeftElbowCollapsed(); //Action var result = robot.LeftElbowCollapse(); //Assert result.IsFailure.ShouldBeTrue(); result.Failure.ShouldBeOfType <LimitedElbowCollapseException>(); robot.LeftElbowPosition.ShouldBe(45); }
public void ExpandRightElbowTest() { //Arrange creator = new MockCreatorRobot(); MockRobot robot = ((MockRobot)creator .MakeARobot()) .WithRightElbowCollapsed(); //Action var result = robot.RightElbowExpand(); //Assert result.IsSuccess.ShouldBeTrue(); result.Success.ShouldBe(90); robot.RightElbowPosition.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(); }
public void RotateLeftWristToTheLeftDenyBecauseItIsLimitedTest() { //Arrange creator = new MockCreatorRobot(); MockRobot robot = ((MockRobot)creator .MakeARobot()) .WithLeftElbowCollapsed() .WithLeftWristLimitedToLeftDirection(); //Action var result = robot.LeftWristRotateToTheLeft(); //Assert result.IsFailure.ShouldBeTrue(); result.Failure.ShouldBeOfType <LimitedWristRotateException>(); robot.LeftWristDirection.ShouldBe(180); }
public void ExpandLeftElbowTwoTimesTest() { //Arrange creator = new MockCreatorRobot(); MockRobot robot = ((MockRobot)creator .MakeARobot()) .WithLeftElbowCollapsed(); //Action robot.LeftElbowExpand(); var result = robot.LeftElbowExpand(); //Assert result.IsSuccess.ShouldBeTrue(); result.Success.ShouldBe(135); robot.LeftElbowPosition.ShouldBe(135); }
public void ExpandRightElbowAndSetWristToInitialStateTest() { //Arrange creator = new MockCreatorRobot(); MockRobot robot = ((MockRobot)creator .MakeARobot()) .WithRightWristLimitedToLeftDirection() .WithRightElbowCollapsed(); //Action var result = robot.RightElbowExpand(); //Assert result.IsSuccess.ShouldBeTrue(); result.Success.ShouldBe(90); robot.RightElbowPosition.ShouldBe(90); robot.RightWristDirection.ShouldBe(0); }
public void Setup() { creator = new ConcreteRobotFactory(); }