From: Choy R. <ch...@us...> - 2005-04-08 00:05:18
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11021/DotNetMock/Dynamic Modified Files: DynamicMock.cs ExpectationMethod.cs IMethodCallExpectation.cs Log Message: Make IMethodCallExpectation even more minimal. Index: IMethodCallExpectation.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/IMethodCallExpectation.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IMethodCallExpectation.cs 4 Mar 2005 00:18:42 -0000 1.1 --- IMethodCallExpectation.cs 8 Apr 2005 00:05:09 -0000 1.2 *************** *** 14,22 **** { /// <summary> - /// Actual <see cref="MethodCall"/>. - /// </summary> - MethodCall ActualMethodCall { set; } - - /// <summary> /// Expected method name. /// </summary> --- 14,17 ---- *************** *** 24,39 **** /// <summary> ! /// Expected return value. ! /// </summary> ! object ReturnValue { get; } ! ! /// <summary> ! /// Verify this expectation. /// </summary> /// <remarks> ! /// I'd extend <see cref="IVerifiable"/> but that ! /// currently causes compilation problems. /// </remarks> ! void Verify(); } } --- 19,31 ---- /// <summary> ! /// Check actual incoming method call and return expected outgoing response. /// </summary> + /// <param name="call">incoming call</param> + /// <returns>expected return value</returns> /// <remarks> ! /// The outgoing response may be an exception or the modification ! /// of ref/out parameters. /// </remarks> ! object CheckCallAndSendResponse(MethodCall call); } } Index: DynamicMock.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/DynamicMock.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** DynamicMock.cs 4 Mar 2005 00:18:41 -0000 1.20 --- DynamicMock.cs 8 Apr 2005 00:05:09 -0000 1.21 *************** *** 191,197 **** } IMethodCallExpectation e = nextExpectation(methodCall); ! e.ActualMethodCall = methodCall; ! e.Verify(); ! return e.ReturnValue; } /// <summary> --- 191,195 ---- } IMethodCallExpectation e = nextExpectation(methodCall); ! return e.CheckCallAndSendResponse(methodCall); } /// <summary> Index: ExpectationMethod.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/ExpectationMethod.cs,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ExpectationMethod.cs 4 Mar 2005 00:18:42 -0000 1.21 --- ExpectationMethod.cs 8 Apr 2005 00:05:09 -0000 1.22 *************** *** 246,249 **** --- 246,260 ---- } } + + /// <summary> + /// Check actual incoming method call and return expected outgoing response. + /// <see cref="IMethodCallExpectation.CheckCallAndSendResponse"/> + /// </summary> + public object CheckCallAndSendResponse(MethodCall call) + { + _actualMethodCall = call; + this.Verify(); + return _expectedReturnValue; + } } } |