From: Steve F. <sm...@us...> - 2003-08-11 21:25:09
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects/dynamic In directory sc8-pr-cvs1:/tmp/cvs-serv30756/src/core/test/mockobjects/dynamic Modified Files: CoreMockTest.java Log Message: Added support for proxies testing equality with null Thanks to Richard Burgess Index: CoreMockTest.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/test/mockobjects/dynamic/CoreMockTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- CoreMockTest.java 9 Jul 2003 23:54:20 -0000 1.2 +++ CoreMockTest.java 11 Aug 2003 21:25:07 -0000 1.3 @@ -111,15 +111,24 @@ Verifier.verifyObject(this); } - public void testProxyInequality() throws Exception { + public void testProxyInequality() throws Exception { mockCallables.callResult = new Boolean(false); mockCallables.addExpectedCall("equals", new Object[] {"not a proxy"}); - - assertFalse("Should handle proxy inequality by calling through", proxy.equals("not a proxy")); - - Verifier.verifyObject(this); - } + + assertFalse("Should handle proxy inequality by calling through", proxy.equals("not a proxy")); + + Verifier.verifyObject(this); + } + + public void testProxyEqualityWithNull() throws Exception { + mockCallables.callResult = new Boolean(true); + mockCallables.addExpectedCall("equals", new Object[] {null}); + + assertTrue("Proxy should handle null equality", proxy.equals(null)); + + Verifier.verifyObject(this); + } public void testCallingGetMockNameOnProxyReturnsNameOfUnderlyingMock() { mockCallables.setExpectedCallCalls(0); |