Struct Step
A step structure. Creating a Step will automatically be added to the current step as a child The steps can be nested to allow you to group steps as with meanigful names.
struct Step
;
The steps ends when the Struct is destroyed. In order to have a step that represents a method assign it to a local variable
Constructors
Name | Description |
---|---|
this
(name)
|
Create and attach a step |
Fields
Name | Type | Description |
---|---|---|
suite
|
string | The current suite name. Do not alter this global variable |
test
|
string | The current test name. Do not alter this global variable |
Examples
void TestSetup() @system
{
auto aStep = Step("Given some precondition");
Step("Some setup");
performSomeSetup();
Step("Other setup");
performOtherSetup();
}
// will create this tree:
// Test
// |
// +- Given some precondition
// |
// +- Some setup
// +- Other setup