コード例 #1
0
ファイル: MockTestFilter.cs プロジェクト: elv1s42/nunit
 /// <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;
 }
コード例 #2
0
ファイル: MockTestFilter.cs プロジェクト: elv1s42/nunit
 private bool AssertAndGetEquality(ITest test, MatchFunction calledFunction)
 {
     Assert.AreSame(_expectedTest, test);
     Assert.AreEqual(_expectedFunctionToBeCalled, calledFunction);
     NumberOfMatchCalls += 1;
     return _matchFunctionResult;
 }