Package org.jbehave.core.story.codegen.domain

Examples of org.jbehave.core.story.codegen.domain.ScenarioDetails


public class StoryBuilderBehaviour extends UsingMatchers {

    public void shouldBuildStoryFromStoryDetails() throws Exception {
        // given
        StoryDetails storyDetails = new StoryDetails("Joe drinks vodka", "", "", "");
        ScenarioDetails expectedScenario1 = new ScenarioDetails();
        expectedScenario1.name = "Happy path";
        expectedScenario1.context.givens.add("Joe is thirsty");
        expectedScenario1.event.name = "Joe asks for a Smirnov";
        expectedScenario1.outcome.outcomes.add("bartender serves Joe");
        expectedScenario1.outcome.outcomes.add("Joe is happy");
        storyDetails.addScenario(expectedScenario1);
        ScenarioDetails expectedScenario2 = new ScenarioDetails();
        expectedScenario2.name = "Unhappy path";
        expectedScenario2.context.givens.add("Joe is thirsty");
        expectedScenario2.event.name = "Joe asks for an Absolut";
        expectedScenario2.outcome.outcomes.add("bartender denies Joe");
        expectedScenario2.outcome.outcomes.add("Joe is unhappy");
View Full Code Here


    }

    private static void generateOtherStuff(VelocityContext vcontext, StoryDetails story, VelocityEngine ve) throws Exception {
        List scenarios = story.scenarios;
        for (int i = 0; i < scenarios.size(); i++) {
            ScenarioDetails scenario = (ScenarioDetails) scenarios.get(i);
            ContextDetails context = scenario.context;
            givens(context, ve, vcontext);
            event(scenario.event, ve, vcontext);
            outcomes(scenario.outcome, ve, vcontext);
View Full Code Here

  }
 
  // scenarios

  public void inAScenario(AScenario node) {
    scenario = new ScenarioDetails();
    story.addScenario(scenario);
  }
View Full Code Here

  public void shouldBuildStoryDetailsWithEmptyScenario() throws Exception {
    // given
    String text =
      "Title: Joe drinks vodka\n"
      + "Scenario: Happy path\n";
    ScenarioDetails expectedScenario = new ScenarioDetails();
    expectedScenario.name = "Happy path";
    StoryDetails expectedStory = new StoryDetails("Joe drinks vodka", "", "", "");
    expectedStory.addScenario(expectedScenario);

    // when
View Full Code Here

            + "Given an equally thirsty Joe\n"
            + "When Joe asks for an Absolut\n"
            + "Then bartender tells Joe it is sold out\n"
            + "Then Joe is unhappy\n";
        StoryDetails expectedStory = new StoryDetails("Joe drinks vodka", "", "", "");
        ScenarioDetails expectedScenario1 = new ScenarioDetails();
        expectedScenario1.name = "Happy path";
        expectedScenario1.context.givens.add("a bar downtown");
        expectedScenario1.context.givens.add("a thirsty Joe");
        expectedScenario1.event.name = "Joe asks for a Smirnov";
        expectedScenario1.outcome.outcomes.add("bartender serves Joe");
        expectedScenario1.outcome.outcomes.add("Joe is happy");
        expectedStory.addScenario(expectedScenario1);
        ScenarioDetails expectedScenario2 = new ScenarioDetails();
        expectedScenario2.name = "Unhappy path";
        expectedScenario2.context.givens.add("a pub uptown");
        expectedScenario2.context.givens.add("an equally thirsty Joe");
        expectedScenario2.event.name = "Joe asks for an Absolut";
        expectedScenario2.outcome.outcomes.add("bartender tells Joe it is sold out");
View Full Code Here

TOP

Related Classes of org.jbehave.core.story.codegen.domain.ScenarioDetails

Copyright © 2018 www.massapicom. 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.