Esempio n. 1
0
 private void InvokeAction(Action <StringStep> action, StringStep step)
 {
     try
     {
         action(step);
     }
     catch (Exception e)
     {
         if (!(step.StepResult.Result is Failed))
         {
             step.Fail(e);
         }
     }
 }
Esempio n. 2
0
 public void Run(StringStep step)
 {
     try
     {
         if (!ActionCatalog.ActionExists(step))
         {
             var pendReason = string.Format("No matching Action found for \"{0}\"", step);
             step.PendNotImplemented(pendReason);
         }
         else
         {
             RunStep(step);
         }
     }
     catch (Exception e)
     {
         var realException = FindUsefulException(e);
         step.Fail(realException);
     }
 }
Esempio n. 3
0
        public void Run(StringStep step)
        {
            var stepImplementation = resolvers
                                     .Select(resolver => resolver.ResolveStep(step))
                                     .FirstOrDefault(action => action != null);

            if (stepImplementation == null)
            {
                step.PendNotImplemented("No implementation found");
                return;
            }

            try
            {
                stepImplementation();
            }
            catch (Exception ex)
            {
                var realException = FindUsefulException(ex);
                step.Fail(realException);
            }
        }
Esempio n. 4
0
 public void Run(StringStep step)
 {
     try
     {
         if (!ActionCatalog.ActionExists(step))
         {
             var pendReason = string.Format("No matching Action found for \"{0}\"", step);
             step.PendNotImplemented(pendReason);
         }
         else
         {
             RunStep(step);
         }
     }
     catch (Exception e)
     {
         var realException = FindUsefulException(e);
         step.Fail(realException);
     }
 }