private static async Task PerformReusableScenarioPart(ITestScenario scenario) { await scenario.Step("This is the second step", async() => { await scenario.Step("This is the first sub-step of second step", () => { // Here comes the logic }); await scenario.Step("This is the second sub-step of second step", () => { // Here comes the logic }); }); }
public static async Task <T> Step <T>(this ITestScenario scenarioStepExecutor, string description, Func <Task <T> > action, [CallerFilePath] string filePath = "", [CallerMemberName] string methodName = "", [CallerLineNumber] int lineNumber = 0) { T result = default(T); await scenarioStepExecutor.Step(description, async() => { result = await action(); }, filePath, methodName, lineNumber); return(result); }