Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
 internal static ExpectationCommand <T> NegateIfNeeded <T>(this ExpectationCommand <T> cmd, bool negated)
 {
     if (negated)
     {
         cmd = cmd.Negated();
     }
     return(cmd);
 }
Ejemplo n.º 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));
            }
        }
Ejemplo n.º 4
0
 internal EnumerableExpectation(ExpectationCommand <IEnumerable> cmd)
 {
     _cmd = cmd;
 }
 public CaptureExceptionCommand(ExpectationCommand <T> inner)
 {
     _inner = inner;
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 9
0
 public AnyCommand(ExpectationCommand <IEnumerable> inner) : base(inner)
 {
 }
Ejemplo n.º 10
0
 internal ExpectationBuilder(Action thunk, bool negated, string given, AsserterBehavior behavior)
 {
     _cmd = ExpectationCommand.TestCode(thunk, negated, given, behavior);
 }
Ejemplo n.º 11
0
 public ConsistentlyCommand(TimeSpan duration,
                            ExpectationCommand <T> inner)
 {
     _duration = duration;
     _inner    = inner;
 }
Ejemplo n.º 12
0
 public ItemsCommand(ExpectationCommand <IEnumerable> inner)
 {
     _inner = inner;
 }
Ejemplo n.º 13
0
 internal static ExpectationCommand <IEnumerable <T> > Items <T>(this ExpectationCommand <IEnumerable> inner)
 {
     return(new ExpectationCommand.ItemsCommand <T>(inner));
 }
Ejemplo n.º 14
0
 public CardinalityCommand(ExpectationCommand <IEnumerable> inner, int?min, int?max, bool outer) : base(inner)
 {
     _min   = min;
     _max   = max;
     _outer = outer;
 }
Ejemplo n.º 15
0
 public CastCommand(ExpectationCommand <TFrom> inner)
 {
     _inner = inner;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 18
0
 public EventuallyCommand(TimeSpan duration, ExpectationCommand <T> inner)
 {
     _duration = duration;
     _inner    = inner;
 }
Ejemplo n.º 19
0
 protected SequenceCommandBase(ExpectationCommand <IEnumerable> inner)
 {
     _inner = inner;
 }