public static IRule <T> That <T>(this IBeforeRule <T> beforeRule, bool condition, Exception exception = null) { var realBefore = (IRealBeforeRule <T>)beforeRule; return(realBefore.CombineWith(() => condition ? null : exception ?? Exceptions.GetDefaultException())); }
public static IBeforeRule <TNew> WithContext <TOld, TNew>(this IBeforeRule <TOld> beforeRule, TNew context) { var realBeforeRule = (IRealBeforeRule <TOld>)beforeRule; return(new ContextSwitcher <TOld, TNew>(realBeforeRule, context)); }
public FluentEnsureTests() { _ensure = FluentEnsure.StartEnsure(); }