"|11|12|" + NL +
"|21|22|";
Story story = parser.parseStory(wholeStory, storyPath);
Scenario scenario = story.getScenarios().get(0);
GivenStories givenStories = scenario.getGivenStories();
assertThat(givenStories.asString(), equalTo("path/to/one#{0}, path/to/two#{1}, path/to/three#{2}, path/to/four#{a}, path/to/five"));
assertThat(givenStories.toString(), containsString(givenStories.asString()));
assertThat(givenStories.getPaths(), equalTo(asList(
"path/to/one#{0}", // matches first parameters row
"path/to/two#{1}", // matches second parameters row
"path/to/three#{2}", // does not match any parameters row
"path/to/four#{a}", // does not use valid anchor (an int)
"path/to/five"))); // does not require parameters
assertThat(givenStories.requireParameters(), equalTo(true));
GivenStory givenStory1 = givenStories.getStories().get(0);
assertThat(givenStory1.hasAnchor(), equalTo(true));
assertThat(givenStory1.getAnchor(), equalTo("0"));
assertThat(givenStory1.getPath(), equalTo("path/to/one"));
assertThat(givenStory1.getParameters().get("one"), equalTo("11"));
assertThat(givenStory1.getParameters().get("two"), equalTo("12"));
GivenStory givenStory2 = givenStories.getStories().get(1);
assertThat(givenStory2.hasAnchor(), equalTo(true));
assertThat(givenStory2.getAnchor(), equalTo("1"));
assertThat(givenStory2.getPath(), equalTo("path/to/two"));
assertThat(givenStory2.getParameters().get("one"), equalTo("21"));
assertThat(givenStory2.getParameters().get("two"), equalTo("22"));
GivenStory givenStory3 = givenStories.getStories().get(2);
assertThat(givenStory3.hasAnchor(), equalTo(true));
assertThat(givenStory3.getAnchor(), equalTo("2"));
assertThat(givenStory3.getPath(), equalTo("path/to/three"));
assertThat(givenStory3.getParameters().size(), equalTo(0));
GivenStory givenStory4 = givenStories.getStories().get(3);
assertThat(givenStory4.hasAnchor(), equalTo(true));
assertThat(givenStory4.getAnchor(), equalTo("a"));
assertThat(givenStory4.getPath(), equalTo("path/to/four"));
assertThat(givenStory4.getParameters().size(), equalTo(0));
GivenStory givenStory5 = givenStories.getStories().get(4);
assertThat(givenStory5.hasAnchor(), equalTo(false));
assertThat(givenStory5.getAnchor(), equalTo(""));
assertThat(givenStory5.getPath(), equalTo("path/to/five"));
assertThat(givenStory5.getParameters().size(), equalTo(0));
}