コード例 #1
0
 public SingletonCommand(Func <T> thunk, bool negated, string given, AsserterBehavior behavior)
 {
     _thunk    = thunk;
     _negated  = negated;
     _given    = given;
     _behavior = behavior;
 }
コード例 #2
0
        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));
            }
        }
コード例 #3
0
 internal ExpectationBuilder(Action thunk, bool negated, string given, AsserterBehavior behavior)
 {
     _cmd = ExpectationCommand.TestCode(thunk, negated, given, behavior);
 }
コード例 #4
0
 internal Asserter(bool assumption)
 {
     _defaultBehavior = assumption ? AsserterBehavior.Assumption : AsserterBehavior.Default;
 }
コード例 #5
0
 public static ExpectationCommand <Unit> TestCode(Action action, bool negated, string given, AsserterBehavior behavior)
 {
     return(Of(Unit.Thunk(action), negated, given, behavior));
 }
コード例 #6
0
 public static ExpectationCommand <T> Of <T>(Func <T> thunk, bool negated, string given, AsserterBehavior behavior)
 {
     return(new SingletonCommand <T>(thunk, negated, given, behavior));
 }
コード例 #7
0
 internal GivenExpectationBuilder(AsserterBehavior behavior)
 {
     Behavior = behavior;
 }