getgauge / gauge-csharp

Csharp runner for Gauge
https://gauge.org
GNU General Public License v3.0
33 stars 21 forks source link

Add support for running asynchronous Steps #151

Closed BugDiver closed 5 years ago

BugDiver commented 5 years ago

Expected behavior

Should be able to deal with async/await natively

Actual behavior

support for async/await is not there. The user has to manually add Task.run/wait in their code.

gaugebot[bot] commented 5 years ago

The fix should be available in nightly >= 28-11-2018

zabil commented 5 years ago

@BugDiver can you share a step implementation of before and after with this change?

mrbcmorris commented 5 years ago

Before change:

        [Step("A step")]
        public void Step()
        {
            Task.Delay(15).Wait();
            throw new CustomSerializableException("Step failed");
        }

After change: https://github.com/getgauge/gauge-csharp/blob/95de74229ab8cdb89cecf47fd7eff4b97a23b829/IntegrationTestSample/StepImplementation.cs#L36-L41

N.B.: The after change code snippet would compile and run prior to #150 but would be incorrectly reported as a passing test.