protected override TestFailure ShouldCore(IEnumerable <object> items, ITestMatcher <object> baseMatcher) { var tally = Tally.New(items, Matchers.Not(baseMatcher), t => (t.Failures == 5), TestMatcherLocalizer.FailurePredicate(baseMatcher)); return(tally.Lift("notAny", SR.ExpectedNotAnyElementTo())); }
protected override TestFailure ShouldCore(IEnumerable <object> items, ITestMatcher <object> baseMatcher) { var tally = Tally.New(items, Matchers.Not(baseMatcher), t => (t.Successes > 0), TestMatcherLocalizer.FailurePredicate(baseMatcher)); if (tally.Successes > 0) { return(null); } return(tally.Lift("notAll", SR.ExpectedNotAllElementsTo())); }
public override TestFailure Should(ITestMatcher <T> matcher) { var actual = TestActual.Of(_thunk); if (_negated) { matcher = Matchers.Not(matcher); } if (matcher.Matches(actual)) { return(null); } var result = TestMatcherLocalizer.Failure(matcher, actual.Value) .UpdateGiven(_given) .UpdateBehavior(_behavior); if (matcher is ITestMatcher <Unit> m) { result.UpdateActual(DisplayActual.Exception(actual.Exception)); } return(result); }
internal void NotThat <T>(T actual, ITestMatcher <T> matcher, string message = null, params object[] args) { That(actual, Matchers.Not(matcher), message, (object[])args); }
ITestMatcher <object> ITestMatcherFactory <object> .CreateMatcher(TestContext testContext) { return(Matchers.Not(Matchers.BeNull())); }