Examples of addOutcome()


Examples of org.jbehave.core.model.OutcomesTable.addOutcome()

        reporter.afterScenario();

        // 2nd scenario
        reporter.beforeScenario("A failing scenario");
        OutcomesTable outcomesTable = new OutcomesTable();
        outcomesTable.addOutcome("I don't return all", 100.0, equalTo(50.));
        try {
            outcomesTable.verify();
        } catch (UUIDExceptionWrapper e) {
            reporter.failedOutcomes("Then I don't return loan", ((OutcomesFailed)e.getCause()).outcomesTable());
        }
View Full Code Here

Examples of org.jbehave.core.model.OutcomesTable.addOutcome()

  }

  @Then("the traders returned are: %tradersTable")
  public void theTradersReturnedAre(ExamplesTable tradersTable) {
    OutcomesTable outcomes = new OutcomesTable();
    outcomes.addOutcome("traders", searchedTraders.toString(), equalTo(toTraders(tradersTable).toString()));
    outcomes.addOutcome("a success", "Any Value", equalTo("Any Value"));
    outcomes.verify();
  }

  private List<Trader> toTraders(ExamplesTable table) {
View Full Code Here

Examples of org.jbehave.core.model.OutcomesTable.addOutcome()

  @Then("the traders returned are: %tradersTable")
  public void theTradersReturnedAre(ExamplesTable tradersTable) {
    OutcomesTable outcomes = new OutcomesTable();
    outcomes.addOutcome("traders", searchedTraders.toString(), equalTo(toTraders(tradersTable).toString()));
    outcomes.addOutcome("a success", "Any Value", equalTo("Any Value"));
    outcomes.verify();
  }

  private List<Trader> toTraders(ExamplesTable table) {
    List<Trader> traders = new ArrayList<Trader>();
View Full Code Here

Examples of org.jbehave.core.model.OutcomesTable.addOutcome()

        } else {
            reporter.pending("Then I should have a balance of $30");
        }
        reporter.notPerformed("Then I should have $20");
        OutcomesTable outcomesTable = new OutcomesTable(new LocalizedKeywords(), "dd/MM/yyyy");
        outcomesTable.addOutcome("I don't return all", 100.0, equalTo(50.));
        Date actualDate = dateFor("01/01/2011");
        Date expectedDate = dateFor("02/01/2011");
        outcomesTable.addOutcome("A wrong date", actualDate, new IsDateEqual(expectedDate, outcomesTable.getDateFormat()));
        try {
            outcomesTable.verify();
View Full Code Here

Examples of org.jbehave.core.model.OutcomesTable.addOutcome()

        reporter.notPerformed("Then I should have $20");
        OutcomesTable outcomesTable = new OutcomesTable(new LocalizedKeywords(), "dd/MM/yyyy");
        outcomesTable.addOutcome("I don't return all", 100.0, equalTo(50.));
        Date actualDate = dateFor("01/01/2011");
        Date expectedDate = dateFor("02/01/2011");
        outcomesTable.addOutcome("A wrong date", actualDate, new IsDateEqual(expectedDate, outcomesTable.getDateFormat()));
        try {
            outcomesTable.verify();
        } catch (UUIDExceptionWrapper e) {
            reporter.failedOutcomes("Then I don't return loan", ((OutcomesFailed) e.getCause()).outcomesTable());
        }
View Full Code Here

Examples of org.jbehave.core.model.OutcomesTable.addOutcome()

        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();
    }

View Full Code Here

Examples of org.jbehave.core.model.OutcomesTable.addOutcome()

            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();
    }

}
View Full Code Here

Examples of org.jbehave.core.model.OutcomesTable.addOutcome()

        // When
        OutcomesTable outcomesTable = new OutcomesTable(new LocalizedKeywords(), "dd/MM/yyyy");
        Date actualDate = StoryNarrator.dateFor("01/01/2011");
        Date expectedDate = StoryNarrator.dateFor("02/01/2011");
        outcomesTable.addOutcome("A wrong date", actualDate, new IsDateEqual(expectedDate, outcomesTable.getDateFormat()));
        try {
            outcomesTable.verify();
        } catch (UUIDExceptionWrapper e) {
            reporter.failedOutcomes("some step", ((OutcomesFailed) e.getCause()).outcomesTable());
        }
View Full Code Here

Examples of org.jbehave.core.model.OutcomesTable.addOutcome()

  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();
  }
 
  private static class Car {
View Full Code Here

Examples of org.jbehave.core.model.OutcomesTable.addOutcome()

    static class FailingSteps extends Steps {

        @When("outcome fails for $name upon verification")
        public void whenOutcomeFails(String name) {
            OutcomesTable outcomes = new OutcomesTable();
            outcomes.addOutcome("failing", name, equalTo(""));
            outcomes.verify();
        }

    }
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.