use of org.jbehave.core.steps.Parameters in project jbehave-core by jbehave.
the class UserSteps method createUsersFromTable.
@Given("the users for $orgName: $userTable")
public void createUsersFromTable(String orgName, ExamplesTable table) {
Organization org = organizationDao.findByName(orgName);
List<Parameters> parametersList = table.getRowsAsParameters(true);
for (Parameters parameters : parametersList) {
userDao.persist(new UserBuilder(org, parameters, table.getHeaders()).build());
}
}
use of org.jbehave.core.steps.Parameters in project javaparser by javaparser.
the class CommentParsingSteps method thenTheLineCommentsHaveTheFollowingPositions.
@Then("the line comments have the following positions: $table")
public void thenTheLineCommentsHaveTheFollowingPositions(ExamplesTable examplesTable) {
int index = 0;
for (Parameters exampleRow : examplesTable.getRowsAsParameters()) {
Comment expectedLineComment = toComment(exampleRow, new LineComment());
Comment lineCommentUnderTest = getCommentAt(commentsCollection.getLineComments(), index);
Range underTestRange = lineCommentUnderTest.getRange().get();
Range expectedRange = expectedLineComment.getRange().get();
assertThat(underTestRange.begin.line, is(expectedRange.begin.line));
assertThat(underTestRange.begin.column, is(expectedRange.begin.column));
assertThat(underTestRange.end.line, is(expectedRange.end.line));
assertThat(underTestRange.end.column, is(expectedRange.end.column));
index++;
}
}
use of org.jbehave.core.steps.Parameters in project javaparser by javaparser.
the class CommentParsingSteps method thenTheJavadocCommentsHaveTheFollowingPositions.
@Then("the Javadoc comments have the following positions: $table")
public void thenTheJavadocCommentsHaveTheFollowingPositions(ExamplesTable examplesTable) {
int index = 0;
for (Parameters exampleRow : examplesTable.getRowsAsParameters()) {
Comment expectedLineComment = toComment(exampleRow, new BlockComment());
Comment lineCommentUnderTest = getCommentAt(commentsCollection.getJavadocComments(), index);
Range underTestRange = lineCommentUnderTest.getRange().get();
Range expectedRange = expectedLineComment.getRange().get();
assertThat(underTestRange.begin.line, is(expectedRange.begin.line));
assertThat(underTestRange.begin.column, is(expectedRange.begin.column));
assertThat(underTestRange.end.line, is(expectedRange.end.line));
assertThat(underTestRange.end.column, is(expectedRange.end.column));
index++;
}
}
use of org.jbehave.core.steps.Parameters in project jbehave-core by jbehave.
the class GherkinSteps method thenICanDriveThemAccordingTo.
@Then("I can drive them according to wheels: $table")
public void thenICanDriveThemAccordingTo(ExamplesTable table) {
OutcomesTable outcomes = new OutcomesTable();
for (Parameters row : table.getRowsAsParameters()) {
Integer wheels = row.valueAs("wheels", Integer.class);
Boolean canDriveWith = car.canDriveWith(wheels);
outcomes.addOutcome("wheels " + wheels, canDriveWith, Matchers.is(row.valueAs("can_drive", Boolean.class)));
}
outcomes.verify();
}
use of org.jbehave.core.steps.Parameters in project jbehave-core by jbehave.
the class FrSteps method theResultsMultipliedByAre.
@Then("les valeurs multipliƩes par $multiplier sont: $table")
public void theResultsMultipliedByAre(int multiplier, ExamplesTable results) {
OutcomesTable outcomes = new OutcomesTable(new LocalizedKeywords(new Locale("fr")));
for (int row = 0; row < results.getRowCount(); row++) {
Parameters expected = results.getRowAsParameters(row);
Parameters original = table.getRowAsParameters(row);
int one = original.valueAs("un", Integer.class);
int two = original.valueAs("deux", Integer.class);
outcomes.addOutcome("un", one * multiplier, Matchers.equalTo(expected.valueAs("un", Integer.class)));
outcomes.addOutcome("deux", two * multiplier, Matchers.equalTo(expected.valueAs("deux", Integer.class)));
}
outcomes.verify();
}
Aggregations