internal static ExpectationCommand <IEnumerable <object> > Items(this ExpectationCommand <IEnumerable> inner)
 {
     // Provide transparent access to either IEnumerable<object> or IEnumerable depending
     // upon what the matcher implements.  This primarily pertains to HaveLengthMatcher so that
     // it can be used with Array and String using their idiosyncratic handling of
     // IEnumerable and IEnumerable<T>
     return(new ExpectationCommand.ItemsCommand(inner));
 }
Exemple #2
0
 internal static ExpectationCommand <T> NegateIfNeeded <T>(this ExpectationCommand <T> cmd, bool negated)
 {
     if (negated)
     {
         cmd = cmd.Negated();
     }
     return(cmd);
 }
Exemple #3
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));
            }
        }
 internal EnumerableExpectation(ExpectationCommand <IEnumerable> cmd)
 {
     _cmd = cmd;
 }
 public CaptureExceptionCommand(ExpectationCommand <T> inner)
 {
     _inner = inner;
 }
Exemple #6
0
 internal TemporalExpectationBuilder(ExpectationCommand <Unit> cmd)
 {
     _cmd = cmd;
 }
 public ComparerCommand(IComparer <T> comparer, ExpectationCommand <T> inner)
 {
     _inner    = inner;
     _comparer = comparer;
 }
 public static ExpectationCommand <T> Comparer <T>(IComparer <T> comparer, ExpectationCommand <T> inner)
 {
     return(new ComparerCommand <T>(comparer, inner));
 }
Exemple #9
0
 public AnyCommand(ExpectationCommand <IEnumerable> inner) : base(inner)
 {
 }
 internal ExpectationBuilder(Action thunk, bool negated, string given, AsserterBehavior behavior)
 {
     _cmd = ExpectationCommand.TestCode(thunk, negated, given, behavior);
 }
Exemple #11
0
 public ConsistentlyCommand(TimeSpan duration,
                            ExpectationCommand <T> inner)
 {
     _duration = duration;
     _inner    = inner;
 }
 public ItemsCommand(ExpectationCommand <IEnumerable> inner)
 {
     _inner = inner;
 }
 internal static ExpectationCommand <IEnumerable <T> > Items <T>(this ExpectationCommand <IEnumerable> inner)
 {
     return(new ExpectationCommand.ItemsCommand <T>(inner));
 }
Exemple #14
0
 public CardinalityCommand(ExpectationCommand <IEnumerable> inner, int?min, int?max, bool outer) : base(inner)
 {
     _min   = min;
     _max   = max;
     _outer = outer;
 }
 public CastCommand(ExpectationCommand <TFrom> inner)
 {
     _inner = inner;
 }
Exemple #16
0
 internal Expectation(ExpectationCommand <Unit> cmd)
 {
     _cmd = cmd;
 }
 public PropertyCommand(ExpectationCommand <T> inner, Func <T, TProperty> accessor, string name)
 {
     _inner    = inner;
     _accessor = accessor;
     _name     = name;
 }
Exemple #18
0
 public EventuallyCommand(TimeSpan duration, ExpectationCommand <T> inner)
 {
     _duration = duration;
     _inner    = inner;
 }
Exemple #19
0
 protected SequenceCommandBase(ExpectationCommand <IEnumerable> inner)
 {
     _inner = inner;
 }