Package com.tngtech.jgiven.impl
Class Scenario<GIVEN,WHEN,THEN>
java.lang.Object
com.tngtech.jgiven.impl.ScenarioBase
com.tngtech.jgiven.impl.Scenario<GIVEN,WHEN,THEN>
- Type Parameters:
GIVEN- the Given stageWHEN- then When stageTHEN- then Then stage
A default scenario implementation that takes three type arguments,
one for each stage.
-
Field Summary
Fields inherited from class com.tngtech.jgiven.impl.ScenarioBase
executor, modelBuilder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIntroWord(String word) Alias forstartScenario(String).static <GIVEN,WHEN, THEN>
Scenario<GIVEN, WHEN, THEN> Creates a scenario with 3 different steps classes.static <STEPS> Scenario<STEPS, STEPS, STEPS> Creates a scenario with a single steps class.given()protected voidstartScenario(String description) Describes the scenario.then()when()Methods inherited from class com.tngtech.jgiven.impl.ScenarioBase
aborted, addStage, assertNotInitialized, finished, getExecutor, getModel, getScenarioCaseModel, getScenarioModel, section, setExecutor, setModel, setStageClassCreator, setStageCreator, startScenario, wireSteps
-
Constructor Details
-
Scenario
-
-
Method Details
-
getGivenStage
-
getWhenStage
-
getThenStage
-
addIntroWord
-
create
public static <GIVEN,WHEN, Scenario<GIVEN,THEN> WHEN, createTHEN> (Class<GIVEN> givenClass, Class<WHEN> whenClass, Class<THEN> thenClass) Creates a scenario with 3 different steps classes. To share state between the different steps instances use theScenarioStateannotation- Parameters:
givenClass- the Given steps classwhenClass- the When steps classthenClass- the Then steps class- Returns:
- the new scenario
-
create
Creates a scenario with a single steps class. Only creates a single steps instance for all three step types, so noScenarioStateannotations are needed to share state between the different steps instances.- Parameters:
stepsClass- the class to use for given, when and then steps- Returns:
- the new scenario
-
startScenario
Describes the scenario. Must be called before any step invocation.- Overrides:
startScenarioin classScenarioBase- Parameters:
description- the description- Returns:
- this for a fluent interface
-
initialize
protected void initialize()- Overrides:
initializein classScenarioBase
-
as
Alias forstartScenario(String). -
given
-
when
-
then
-
given
-
when
-
then
-