In the current implementation, Given or Then is just synactic suger, and they are semantically identical. This isn't ideal, as there is a proper grammer to when the different kinds of step should be applied.
Currently Scenario is just an untyped builder object, and you can just keep chaining of invocations of Given() or Then() to continue to append new steps. I'm thinking we could add stricter types (via protocols), to encapsulate this logic:
The first step has to be Given
When is optional, and if used must follow Given
Then may follow either Given or When
And can extend any kind of step, but preserves the current kind
In the current implementation,
Given
orThen
is just synactic suger, and they are semantically identical. This isn't ideal, as there is a proper grammer to when the different kinds of step should be applied.Currently
Scenario
is just an untyped builder object, and you can just keep chaining of invocations ofGiven()
orThen()
to continue to append new steps. I'm thinking we could add stricter types (via protocols), to encapsulate this logic:Given
When
is optional, and if used must followGiven
Then
may follow eitherGiven
orWhen
And
can extend any kind of step, but preserves the current kind