This repository has been archived by the owner on Jun 12, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 46
Async steps
adamralph edited this page Dec 10, 2014
·
4 revisions
xBehave.net provides the ability to define asynchronous steps using the async
and await
keywords.
[Scenario]
public void Addition(int x, int y, AsyncCalculator calculator, int answer)
{
"Given the number 1"
.f(() => x = 1);
"And the number 2"
.f(() => y = 2);
"And an asynchronous calculator"
.f(() => calculator = new AsyncCalculator());
"When I add the numbers together"
.f(async () => answer = await calculator.Add(x, y));
"Then the answer is 3"
.f(() => answer.Should().Be(3));
}