-
Notifications
You must be signed in to change notification settings - Fork 0
Steps which return tasks that never complete, are never completed
Michael W Powell edited this page Dec 8, 2020
·
1 revision
This problem occurs when a step contains an expression which returns a Task
which will never be completed.
For example, an expression which assigns a Task
variable will return that Task
:
"Given a task".x(() => task = new Task(() => { }));
// ^^^^^^^^^^^^^^^^^^^^^^^^^^
When the step is executed, xWellBehaved.net will await the Task
before executing the next step. Because the Task
never completes, the step will never complete.
The workaround is to use a block instead of an expression:
"Given a task".x(() => { task = new Task(() => { }); });
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- 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