예제 #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;
 }