Examples of StepOutput


Examples of org.moresbycoffee.mbyhave8.result.StepOutput

        final Step andStep = new MByHaveSpec() {
            Step innerStep = and("an And step", () -> { visited.set(true); return StepResult.Success; });
        }.innerStep;

        final StepOutput result = andStep.execute(DummyStepHooks.DUMMY);

        assertEquals(StepResult.Success, result.getResult());
        assertTrue("The and step execution should execute the step implementation and change the visited flag", visited.get());
    }
View Full Code Here

Examples of org.moresbycoffee.mbyhave8.result.StepOutput

        final Step andStep = new MByHaveSpec() {
            Step innerStep = and("an And step", () -> visited.set(true));
        }.innerStep;

        final StepOutput result = andStep.execute(DummyStepHooks.DUMMY);

        assertEquals(StepResult.Success, result.getResult());
        assertTrue("The and step execution should execute the step implementation and change the visited flag", visited.get());
    }
View Full Code Here

Examples of org.moresbycoffee.mbyhave8.result.StepOutput

    public void implementationLess_and_step_should_return_pending_state() {
        final Step step = new MByHaveSpec() {
            Step innerStep = and("Implementationless Step");
        }.innerStep;

        final StepOutput stepOutput = step.execute(DummyStepHooks.DUMMY);

        assertEquals(StepResult.Pending, stepOutput.getResult());
    }
View Full Code Here

Examples of org.moresbycoffee.mbyhave8.result.StepOutput

            result = ScenarioResult.Pending;
            stepOutputs = Collections.emptyList();
        } else {
            stepOutputs = new ArrayList<StepOutput>(steps.size());
            for (final Step step : steps) {
                final StepOutput stepOutput;
                if (ScenarioResult.Success.equals(result)) {
                    stepOutput = stepExecutor.apply(step, stepHooks);
                    final StepResult stepResult = stepOutput.getResult();
                    if (stepResult instanceof StepResult.Error) {
                        result = ScenarioResult.Error;
                    } else if (stepResult instanceof StepResult.Failure) {
                        result = ScenarioResult.Failure;
                    } else if (stepResult instanceof StepResult.Pending) {
View Full Code Here

Examples of org.moresbycoffee.mbyhave8.result.StepOutput

                        scenarios(asList(
                                ScenarioOutput.builder().
                                description("Scenario: Scenario in error").
                                result(ScenarioResult.Error).
                                steps(asList(
                                        new StepOutput("Given an error step", StepResult.error(error))
                                )).
                                issues(scenarioIssues).build()
                        )).build()
                )
        ));
View Full Code Here

Examples of org.moresbycoffee.mbyhave8.result.StepOutput

                        scenarios(asList(
                                ScenarioOutput.builder().
                                description("Scenario: Scenario in error").
                                result(ScenarioResult.Failure).
                                steps(asList(
                                        new StepOutput("Given an error step", StepResult.failure(error))
                                )).
                                issues(scenarioIssues).build()
                        )).build()
                )
        ));
View Full Code Here

Examples of org.moresbycoffee.mbyhave8.result.StepOutput

        } catch (final Throwable t) {
            t.printStackTrace(); //TODO replace with some logger
            result = StepResult.error(t);
        }
        hooks.endStep(this, result);
        return new StepOutput(getDescription(), result);
    }
View Full Code Here

Examples of org.moresbycoffee.mbyhave8.result.StepOutput

    }

    public StepOutput skip(final StepHooks hooks) {
        hooks.startStep(this);
        hooks.endStep(this, StepResult.Skipped);
        return new StepOutput(getDescription(), StepResult.Skipped);
    }
View Full Code Here

Examples of org.moresbycoffee.mbyhave8.result.StepOutput

*/
public class Given_step_Test {

    @Test
    public void given_step_implementation_without_return_value_should_AssertException_as_failure() {
        final StepOutput stepOutput = failingGivenStep().execute(DummyStepHooks.DUMMY);
        assertThat(stepOutput.getResult(), instanceOf(StepResult.Failure.class));
        assertEquals("Given Failing Given Step", stepOutput.getDescription());
    }
View Full Code Here

Examples of org.moresbycoffee.mbyhave8.result.StepOutput

        assertEquals("Given Failing Given Step", stepOutput.getDescription());
    }

    @Test
    public void given_step_implementation_without_return_value_should_PendingException_as_pending() {
        final StepOutput stepOutput = pendingGivenStep().execute(DummyStepHooks.DUMMY);
        assertEquals(StepResult.Pending, stepOutput.getResult());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.