public SELF the_scenario_has_$_cases(int ncases) { ScenarioModel scenarioModel = reportModel.getLastScenarioModel(); scenarioModel.clearCases(); for (int i = 0; i < ncases; i++) { scenarioModel.addCase(new ScenarioCaseModel()); } return self(); }
private void addDefaultCase(ScenarioModel scenarioModel) { ScenarioCaseModel scenarioCaseModel = new ScenarioCaseModel(); scenarioModel.addCase(scenarioCaseModel); int i = 0; for (String param : scenarioModel.getExplicitParameters()) { scenarioCaseModel.addExplicitArguments("arg" + scenarioCaseModel.getCaseNr() + i++); } scenarioCaseModel.addStep( new StepModel( "something_happens", Arrays.asList(Word.introWord("given"), new Word("something")))); i = 0; for (String arg : scenarioCaseModel.getExplicitArguments()) { String argumentName = "stepArg" + i++; scenarioCaseModel.addStep( new StepModel( "something_happens", asList(Word.introWord("when"), Word.argWord(argumentName, arg, (String) null)))); } }