/// <summary> /// Construct an <see cref="MockTestFilter"/>. /// </summary> /// <param name="expectedTest">The test for which calling the match-function is allowed.</param> /// <param name="expectedMatchFunction">The matching function that should be called.</param> /// <param name="matchFunctionResult">The result of the match function for the expected /// test.</param> public MockTestFilter( ITest expectedTest, MatchFunction expectedMatchFunction, bool matchFunctionResult) : base() { _expectedTest = expectedTest; _expectedFunctionToBeCalled = expectedMatchFunction; _matchFunctionResult = matchFunctionResult; NumberOfMatchCalls = 0; }
private bool AssertAndGetEquality(ITest test, MatchFunction calledFunction) { Assert.AreSame(_expectedTest, test); Assert.AreEqual(_expectedFunctionToBeCalled, calledFunction); NumberOfMatchCalls += 1; return _matchFunctionResult; }