Пример #1
0
 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);
     }
 }
Пример #2
0
 public When(ITestOutputHelper output, StepQueue stepQueue, string when, Action step)
 {
     _output    = output;
     _stepQueue = stepQueue;
     _stepQueue.Enqueue(new Spec(SpecType.When, when, step));
 }
Пример #3
0
 internal EagerGiven(ITestOutputHelper output, StepQueue stepQueue)
 {
     _output    = output;
     _stepQueue = stepQueue;
 }
Пример #4
0
 internal Then(ITestOutputHelper output, StepQueue stepQueue, string then, Action step)
 {
     _output    = output;
     _stepQueue = stepQueue;
     _stepQueue.Enqueue(new Spec(SpecType.Then, then, step));
 }
Пример #5
0
 public ThenAnd(ITestOutputHelper output, StepQueue stepQueue, string and, Action step)
 {
     _output    = output;
     _stepQueue = stepQueue;
     _stepQueue.Enqueue(new Spec(SpecType.And, and, step));
 }
Пример #6
0
 internal Scenario(ITestOutputHelper output, StepQueue stepQueue, string scenario)
 {
     _output    = output;
     _stepQueue = stepQueue;
     _stepQueue.Enqueue(new Spec(SpecType.Scenario, scenario));
 }