Class ScenarioTestBase<GIVEN,WHEN,THEN>

java.lang.Object
com.tngtech.jgiven.base.ScenarioTestBase<GIVEN,WHEN,THEN>
Direct Known Subclasses:
CenarioTesteBase, DualScenarioTestBase, EscenarioTestBase, SimpleScenarioTestBase, SzenarioTestBasis, TestDeScenarioBase

public abstract class ScenarioTestBase<GIVEN,WHEN,THEN> extends Object
Base class for Scenario tests. This class is typically not directly used by end users, but instead test-framework-specific classes for JUnit or TestNG
  • Constructor Details

    • ScenarioTestBase

      public ScenarioTestBase()
  • Method Details

    • createScenario

      protected com.tngtech.jgiven.impl.Scenario<GIVEN,WHEN,THEN> createScenario()
    • given

      public GIVEN given()
    • when

      public WHEN when()
    • then

      public THEN then()
    • section

      public void section(String sectionTitle)
      Adds a new section to the scenario

      EXPERIMENTAL FEATURE

      This is an experimental feature. It might change in the future. If you have any feedback regarding this feature, please let us know by creating an issue at https://github.com/TNG/JGiven/issues
      Parameters:
      sectionTitle - the title of the section
      Since:
      0.11.0
    • wireSteps

      public void wireSteps(CanWire canWire)
    • addStage

      public <T> T addStage(Class<T> stageClass)
      Add a new stage class to the scenario.
      Parameters:
      stageClass - the class with the step definitions
      Returns:
      a new instance of the given class enhanced by JGiven
    • getScenario

      public abstract com.tngtech.jgiven.impl.Scenario<GIVEN,WHEN,THEN> getScenario()
      Returns:
      the scenario associated with this test
    • createNewScenario

      public com.tngtech.jgiven.impl.Scenario<GIVEN,WHEN,THEN> createNewScenario()