public SingletonCommand(Func <T> thunk, bool negated, string given, AsserterBehavior behavior) { _thunk = thunk; _negated = negated; _given = given; _behavior = behavior; }
internal static void Should <T>(this ExpectationCommand <T> self, ITestMatcher <T> matcher, string message = null, object[] args = null) { var failure = self.Should(matcher); if (failure != null) { AsserterBehavior behavior = failure.AsserterBehavior; behavior.Assert(failure.UpdateTestSubject().UpdateMessage(message, args)); } }
internal ExpectationBuilder(Action thunk, bool negated, string given, AsserterBehavior behavior) { _cmd = ExpectationCommand.TestCode(thunk, negated, given, behavior); }
internal Asserter(bool assumption) { _defaultBehavior = assumption ? AsserterBehavior.Assumption : AsserterBehavior.Default; }
public static ExpectationCommand <Unit> TestCode(Action action, bool negated, string given, AsserterBehavior behavior) { return(Of(Unit.Thunk(action), negated, given, behavior)); }
public static ExpectationCommand <T> Of <T>(Func <T> thunk, bool negated, string given, AsserterBehavior behavior) { return(new SingletonCommand <T>(thunk, negated, given, behavior)); }
internal GivenExpectationBuilder(AsserterBehavior behavior) { Behavior = behavior; }