コード例 #1
0
 public static Outcome ToOutcome(this Some <Exception> ex) =>
 ex.ExceptionIsInconclusive()
         ? Outcome.Inconclusive
         : Outcome.Fail;
コード例 #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));
コード例 #3
0
 private static bool ExceptionIsInconclusive(this Some <Exception> ex) =>
 ExceptionTypeNameIsInconclusive(ex.Value.GetType().Name);
コード例 #4
0
 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"));
コード例 #5
0
 public static StepOutcome ToStepOutcome(this Some <Title> title, Outcome outcome) =>
 new StepOutcome(title.Value.Step, outcome, title.Value.Text);
コード例 #6
0
 private static Some <string> WithOutcomeDescribed(this Some <string> prefixedStep, Outcome outcome) =>
 $"{prefixedStep.Value} [{outcome.ToOutcomeText()}]";
コード例 #7
0
 private static bool StartsWithIgnoreCase(this Some <string> text, Some <string> prefix) =>
 text.Value.IndexOf(prefix.Value, StringComparison.InvariantCultureIgnoreCase) == 0;