-
Notifications
You must be signed in to change notification settings - Fork 0
Step metadata
Michael W Powell edited this page Dec 8, 2020
·
2 revisions
The context
object that is passed into a step delegate gives you access to metadata about the current step and scenario.
For example, you may want to interact with the file system isolate all your actions in a dedicated directory for the scenario:
[Scenario]
public void SomeScenario(string directory)
{
"Given a directory".x(context => Directory.CreateDirectory(directory = context.Step.Scenario.DisplayName))
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.Rollback(() => Directory.Delete(directory));
// ^^^^^^^^^
"When...".x(() => ...);
"Then...".x(() => ...);
}
- Home
- Quick start
-
Documentation
- Writing scenarios
- Running scenarios
- Package dependencies
- Debugging scenarios
- Assertions
- Step names
- Debugging Scenarios with examples
- Background methods
- TearDown methods
- Async steps
- Object disposal
- Rollback
- Skipping steps and scenarios
- Step metadata
- Continuing on failure
- Step filters
- Changes in xBehave.net version 2.0
- Changes since deriving from xBehave.net
- Extending xWellBehaved.net
- FAQ
- Known Issues
- Contributions