-
Notifications
You must be signed in to change notification settings - Fork 0
A test class instance is created for each step
This issue affects 1.x versions only. It does not affect versions 2.x and above.
Note that we mention it here for historial xBehave.net reasons only, since xWellBehaved.net derived from the root project well after this was resolved.
In xBehave.net version 1.x, an instance of the test class (if it is not static
) is created once before the scenario is executed and all the steps are executed in the context of that instance.
The xUnit.net runner also creates an instance of the test class before each step is executed. These per-step instances are not used for anything and are superfluous.
However, if the construction of your test class induces static side effects, you may experience issues. The recommendation is to use Backgrounds to create common contexts for your scenarios instead of test class constructors (see also: An instance of the test class is created for every step).
Thanks to George Hemmings for spotting this issue.
- 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