This step can start a sequence of Given / When / Then.
This trait provides building blocks to create steps and examples from regular expression.
This trait provides building blocks to create steps and examples from regular expression.
It is used to implement a Given-When-Then way of describing systems.
Fragments are created by adding a Given
step to a Text
:
"name: ${user}" ^ givenName
This creates a PreStep object containing the current context (representing all the extracted values) and a list of Fragments containing:
Text("name: ${user}")
${}
Then, this PreStep object can be followed by another piece of Text to create a PreStepText object. This object merely
stores the additional Text fragment so that values can be extracted from it when a When
step is added:
// this creates a PreStepText object "name: ${user}" ^ givenName ^ "age: ${38}" // this creates a PreStep object "name: ${user}" ^ givenName ^ "age: ${38}" ^ thenAge ^
Eventually, when a Then
step is added, a sequence of PostStep/PostStepText objects is created. Those objects use
the current context and the results returned by the Then
objects to create Examples.
The last PostStep object contains the list of all fragments created by the Given/When/Then sequence:
This step define checks in a sequence of Given / When / Then.
This step define checks in a sequence of Given / When / Then.
It must define the extract function taking the state of extracted values, T, and return a Result
This step define conditions in a sequence of Given / When / Then.
This step define conditions in a sequence of Given / When / Then.
It must define the extract function taking the previous state of extracted values, P, and creating a new state of type T from the extracted values
This step can start a sequence of Given / When / Then.
It must define the extract function creating a value of type T from the extracted values