bool ITestMatcher <TypeInfo> .Matches(ITestActualEvaluation <TypeInfo> actualFactory) { var actual = actualFactory.Value; var matches = Expected.GetTypeInfo().IsAssignableFrom(actual); return(matches); }
public bool Matches(ITestActualEvaluation <IEnumerable <IGrouping <TKey, TValue> > > actualFactory) { if (actualFactory == null) { throw new ArgumentNullException("actualFactory"); } return(Matches(actualFactory.Value)); }
public bool Matches(ITestActualEvaluation <T> actualFactory) { var myParent = _parent; return(_real.Matches( Actual = TestActual.Of(() => myParent._accessor(actualFactory.Value)) )); }
public bool Matches(ITestActualEvaluation actual) { if (actual == null) { throw new ArgumentNullException(nameof(actual)); } var ex = Record.ApplyFlags(actual.Exception, _flags); return(Expected.GetTypeInfo().IsInstanceOfType(ex)); }
public bool Matches(ITestActualEvaluation <IEnumerable> actualFactory) { var items = actualFactory.Value; if (items == null) { throw SpecFailure.SequenceNullConversion(); } Result = ShouldCore(items.Cast <object>(), _real); return(Result == null); }
public bool Matches(ITestActualEvaluation <TFrom> actualFactory) { var real = TestMatcherName.FromType(_real.GetType()); Func <T> thunk = () => { try { var actual = actualFactory.Value; return((T)(object)actual); } catch (InvalidCastException e) { throw SpecFailure.CastRequiredByMatcherFailure(e, real); } }; return(_real.Matches(TestActual.Of(thunk))); }
public bool Matches(ITestActualEvaluation <IEnumerable> actualFactory) { // When the matcher can already handle the input, no need to apply // adapter logic if (_real is ITestMatcher <IEnumerable> fast) { return(fast.Matches(actualFactory)); } var real = TestMatcherName.FromType(_real.GetType()); Func <IEnumerable <object> > thunk = () => ( actualFactory.Value.Cast <object>() ); return(_real.Matches(TestActual.Of(thunk))); }
public bool Matches(ITestActualEvaluation <T> actualFactory) { return(_matchers.All(t => t.Matches(actualFactory))); }
public bool Matches(ITestActualEvaluation <T> actualFactory) { return(!_matcher.Matches(actualFactory)); }
public bool Matches(ITestActualEvaluation <T> actualFactory) { return(_real.Matches( Actual = TestActual.Value(actualFactory.Exception) )); }
public bool Matches(ITestActualEvaluation testCode) { return(_answer); }
public WrapperEvaluation(ITestActualEvaluation <TTo> inner) { _inner = inner; }
public bool Matches(ITestActualEvaluation <TTo> actualFactory) { return(_matcher.Matches(new WrapperEvaluation(actualFactory))); }
public bool Matches(ITestActualEvaluation <T> actual) { return(_matchers.Any(t => t.Matches(actual))); }