From: Steve F. <sm...@us...> - 2003-04-16 22:17:07
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects/dynamic In directory sc8-pr-cvs1:/tmp/cvs-serv24985/src/core/test/mockobjects/dynamic Modified Files: Tag: DynamicMockExperiment ExpectedCallTest.java Log Message: ExpectedCalls are now only valid for one call. After that they will not match. Index: ExpectedCallTest.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects/dynamic/Attic/ExpectedCallTest.java,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -r1.1.2.5 -r1.1.2.6 --- ExpectedCallTest.java 16 Apr 2003 16:31:47 -0000 1.1.2.5 +++ ExpectedCallTest.java 16 Apr 2003 22:17:04 -0000 1.1.2.6 @@ -75,6 +75,16 @@ mockCallable.verifyExpectations(); } + public void testDoesNotMatchAfterMethodCalled() throws Throwable + { + mockCallable.setupMatchesReturn(true); + mockCallable.setupCallReturn(RESULT); + + assertTrue( "First time should match", call.matches(METHOD_NAME, ARGS)); + call.call(ignoredMock, METHOD_NAME, ARGS); + assertFalse( "Second time should not match", call.matches(METHOD_NAME, ARGS)); + } + public void testDecoratedResultPassedThrough() throws Throwable { mockCallable.setupCallReturn(RESULT); |