public static Outcome ToOutcome(this Some <Exception> ex) =>
 ex.ExceptionIsInconclusive()
         ? Outcome.Inconclusive
         : Outcome.Fail;
Exemple #2
0
 private static Pipe <R> RunStep <T, R>(this Pipe <T> pipe, Some <Title> title, Func <T, Task <R> > step) =>
 RunStep(pipe, title, TaskFunctions.Run(step));
 private static bool ExceptionIsInconclusive(this Some <Exception> ex) =>
 ExceptionTypeNameIsInconclusive(ex.Value.GetType().Name);
 private static bool ExceptionTypeNameIsInconclusive(this Some <string> exceptionTypeName) =>
 string.Equals(exceptionTypeName, "InconclusiveException", StringComparison.InvariantCultureIgnoreCase) ||
 string.Equals(exceptionTypeName, "AssertInconclusiveException", StringComparison.InvariantCultureIgnoreCase) ||
 (exceptionTypeName.Value.StartsWith("Skippable") && exceptionTypeName.Value.EndsWith("Exception"));
 public static StepOutcome ToStepOutcome(this Some <Title> title, Outcome outcome) =>
 new StepOutcome(title.Value.Step, outcome, title.Value.Text);
 private static Some <string> WithOutcomeDescribed(this Some <string> prefixedStep, Outcome outcome) =>
 $"{prefixedStep.Value} [{outcome.ToOutcomeText()}]";
Exemple #7
0
 private static bool StartsWithIgnoreCase(this Some <string> text, Some <string> prefix) =>
 text.Value.IndexOf(prefix.Value, StringComparison.InvariantCultureIgnoreCase) == 0;