Examples of Scenario


Examples of org.jbehave.core.model.Scenario

        when(steps.listCandidates()).thenReturn(asList(candidate, andCandidate));

        // When
        List<Step> executableSteps = stepCollector.collectScenarioSteps(asList(steps),
                new Scenario(asList(myStep, myAndStep)), parameters);

        // Then
        assertThat(executableSteps.size(), equalTo(2));
    }
View Full Code Here

Examples of org.jbehave.core.model.Scenario

        when(compositeCandidate.isComposite()).thenReturn(true);
        when(compositeCandidate.createMatchedStep(compositeStepAsString, parameters)).thenReturn(
                executableCompositeStep);

        // When
        stepCollector.collectScenarioSteps(asList(steps), new Scenario(
                asList(compositeStepAsString)), parameters);

        // Then
        verify(compositeCandidate, times(1)).addComposedSteps(Mockito.eq(new ArrayList<Step>()), Mockito.eq(compositeStepAsString), Mockito.eq(parameters), Mockito.eq(allCandidates));
    }
View Full Code Here

Examples of org.jbehave.core.model.Scenario

        String andWhenPendingStep = "And a when pending step";
        when(steps.listCandidates()).thenReturn(Arrays.<StepCandidate> asList());

        // When
        List<Step> executableSteps = stepCollector.collectScenarioSteps(asList(steps),
                new Scenario(asList(givenPendingStep, andGivenPendingStep, whenPendingStep, andWhenPendingStep)),
                parameters);
        // Then
        assertThat(executableSteps.size(), equalTo(4));
        assertIsPending(executableSteps.get(0), givenPendingStep, null);
        assertIsPending(executableSteps.get(1), andGivenPendingStep, givenPendingStep);
View Full Code Here

Examples of org.jbehave.core.model.Scenario

        when(steps.listCandidates()).thenReturn(
                asList(firstCandidate, secondCandidate, thirdCandidate, fourthCandidate));

        // When
        List<Step> executableSteps = stepCollector.collectScenarioSteps(asList(steps),
                new Scenario(asList(givenPendingStep, andGivenPendingStep, whenPendingStep, andWhenPendingStep)),
                parameters);
        // Then
        assertThat(executableSteps.size(), equalTo(4));
        assertIsPending(executableSteps.get(0), givenPendingStep, null);
        assertIsPending(executableSteps.get(1), andGivenPendingStep, givenPendingStep);
View Full Code Here

Examples of org.jbehave.core.model.Scenario

        String stepAsString = "my ignorable step";
        when(candidate.ignore(stepAsString)).thenReturn(true);
        when(steps.listCandidates()).thenReturn(asList(candidate));

        // When
        List<Step> executableSteps = stepCollector.collectScenarioSteps(asList(steps), new Scenario(
                asList(stepAsString)), parameters);
        // Then
        assertThat(executableSteps.size(), equalTo(1));
        StepResult result = executableSteps.get(0).perform(null);
        assertThat(result, Matchers.instanceOf(Ignorable.class));
View Full Code Here

Examples of org.jbehave.core.model.Scenario

        when(candidate4.createMatchedStep(stepAsString, parameters)).thenReturn(step4);

        // When we collect the list of steps
        StepCollector stepCollector = new MarkUnmatchedStepsAsPending();
        List<Step> steps = stepCollector.collectScenarioSteps(asList(steps1, steps2),
                new Scenario(asList(stepAsString)), parameters);

        // Then the step with highest priority is returned
        assertThat(step4, equalTo(steps.get(0)));
    }
View Full Code Here

Examples of org.jbehave.core.model.Scenario

        when(candidate3.createMatchedStep(stepAsString, parameters)).thenReturn(step3);
        when(candidate4.createMatchedStep(stepAsString, parameters)).thenReturn(step4);

        StepCollector stepCollector = new MarkUnmatchedStepsAsPending(new StepFinder(new ByLevenshteinDistance()));
        List<Step> steps = stepCollector.collectScenarioSteps(asList(steps1, steps2),
                new Scenario(asList(stepAsString)), parameters);

        // Then the step with highest priority is returned
        assertThat(step4, equalTo(steps.get(0)));
    }
View Full Code Here

Examples of org.jbehave.core.story.domain.Scenario

   
    public void renderGiven(Given given) {
    StringBuffer phrase = new StringBuffer();
    phrase.append(previousComponentWasA(Given.class) ? "and " : "Given ");
        if (given instanceof GivenScenario) {
            Scenario givenScenario = ((GivenScenario) given).getScenario();
            phrase.append(new CamelCaseConverter(givenScenario).toPhrase());
        }
        else {
            phrase.append(new CamelCaseConverter(given).toPhrase());
        }
View Full Code Here

Examples of org.libreplan.business.scenarios.entities.Scenario

        }
    }

    private OrderVersion setupVersionUsing(IScenarioManager scenarioManager,
            Order order) {
        Scenario current = scenarioManager.getCurrent();
        OrderVersion result = OrderVersion.createInitialVersion(current);
        order.setVersionForScenario(current, result);
        return result;
    }
View Full Code Here

Examples of org.moresbycoffee.have.domain.Scenario

        }

    }

    void runScenario(final Object testObject, final InputStream scenarioIs) throws IOException, MByHaveException {
        final Scenario scenario = parseScenario(scenarioIs);
        processScenario(testObject, scenario);
    }
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.