internal BddResult(ITestOutputHelper output, StepQueue stepQueue) { _output = output; stepQueue.Steps.ForEach(x => { try { x.Step?.Invoke(); } catch (NotImplementedException e) { _errors.Add(e); } catch (Exception e) { _errors.Add(e); } }); _errors.ForEach(x => _output.WriteLine($"{x.Message}\r\n")); _story = stepQueue.Story(); _output.WriteLine(_story); if (!Success) { throw new TestFailureException("Test Failed. See output for more details.", _story, _errors); } }
public When(ITestOutputHelper output, StepQueue stepQueue, string when, Action step) { _output = output; _stepQueue = stepQueue; _stepQueue.Enqueue(new Spec(SpecType.When, when, step)); }
internal EagerGiven(ITestOutputHelper output, StepQueue stepQueue) { _output = output; _stepQueue = stepQueue; }
internal Then(ITestOutputHelper output, StepQueue stepQueue, string then, Action step) { _output = output; _stepQueue = stepQueue; _stepQueue.Enqueue(new Spec(SpecType.Then, then, step)); }
public ThenAnd(ITestOutputHelper output, StepQueue stepQueue, string and, Action step) { _output = output; _stepQueue = stepQueue; _stepQueue.Enqueue(new Spec(SpecType.And, and, step)); }
internal Scenario(ITestOutputHelper output, StepQueue stepQueue, string scenario) { _output = output; _stepQueue = stepQueue; _stepQueue.Enqueue(new Spec(SpecType.Scenario, scenario)); }