Package org.jbehave.core.model

Examples of org.jbehave.core.model.Narrative.iWantTo()


    Story story = storyParser.parseStory(storyAsText);
    assertThat(story.getDescription().asString(), equalTo("Hello Car"));   
    Narrative narrative = story.getNarrative();
    assertThat(narrative.inOrderTo(), equalTo("feel safer"));
    assertThat(narrative.asA(), equalTo("car driver"));
    assertThat(narrative.iWantTo(), equalTo("drive cars on 4 wheels"));
  }

  @Test
  public void shouldParseStoryWithAlternativeNarrative() throws IOException{
    String storyAsText = "Feature: Hello Car\n"
View Full Code Here


          + "Then I can drive it.\n";
    Story story = storyParser.parseStory(storyAsText);
        assertThat(story.getDescription().asString(), equalTo("Hello Car"));
        Narrative narrative = story.getNarrative();
        assertThat(narrative.asA(), equalTo("car driver"));
        assertThat(narrative.iWantTo(), equalTo("drive cars on 4 wheels"));
        assertThat(narrative.soThat(), equalTo("I can feel safer"));
  }

    @Test
    public void shouldParseStoryWithBackground() throws IOException{
View Full Code Here

        assertThat(description.asString(), equalTo("Story: This is free-text description"));
        Narrative narrative = story.getNarrative();
        assertThat(narrative.isEmpty(), not(true));
        assertThat(narrative.inOrderTo().toString(), equalTo("renovate my house"));
        assertThat(narrative.asA().toString(), equalTo("customer"));
        assertThat(narrative.iWantTo().toString(), equalTo("get a loan"));
    }

    @Test
    public void shouldParseStoryWithAlternativeNarrative() {
        String wholeStory = "Story: This is free-text description"+ NL +
View Full Code Here

        Description description = story.getDescription();
        assertThat(description.asString(), equalTo("Story: This is free-text description"));
        Narrative narrative = story.getNarrative();
        assertThat(narrative.isEmpty(), not(true));
        assertThat(narrative.asA().toString(), equalTo("customer"));
        assertThat(narrative.iWantTo().toString(), equalTo("get a loan"));
        assertThat(narrative.soThat().toString(), equalTo("I can renovate my house"));
    }

    @Test
    public void shouldParseStoryWithIncompleteNarrative() {
View Full Code Here

        public XRefStory(Story story, StoryReporterBuilder storyReporterBuilder, boolean passed, boolean pending) {
            this.story = story;
            Narrative narrative = story.getNarrative();
            if (!narrative.isEmpty()) {
                this.narrative = "In order to " + narrative.inOrderTo() + "\n" + "As a " + narrative.asA() + "\n"
                        + "I want to " + narrative.iWantTo() + "\n";
            }
            this.description = story.getDescription().asString();
            this.name = story.getName();
            this.path = story.getPath();
            this.passed = passed;
View Full Code Here

    public void beforeStory(Story story, boolean givenStory) {
        print(format("beforeStory", "{0}\n({1})\n", story.getDescription().asString(), story.getPath()));
        if (!story.getNarrative().isEmpty()) {
            Narrative narrative = story.getNarrative();
            print(format("narrative", "{0}\n{1} {2}\n{3} {4}\n{5} {6}\n", keywords.narrative(), keywords.inOrderTo(),
                    narrative.inOrderTo(), keywords.asA(), narrative.asA(), keywords.iWantTo(), narrative.iWantTo()));
        }
    }

    public void afterStory(boolean givenStory) {
        print(format("afterStory", "\n"));
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.