1 3 package org.jmock.core.matcher; 4 5 import org.jmock.core.Invocation; 6 7 8 public class InvokeOnceMatcher 9 extends InvokedRecorder 10 { 11 public boolean matches( Invocation invocation ) { 12 return !hasBeenInvoked(); 13 } 14 15 public void verify() { 16 verifyHasBeenInvoked(); 17 } 18 19 public boolean hasDescription() { 20 return true; 21 } 22 23 public StringBuffer describeTo( StringBuffer buffer ) { 24 buffer.append("expected once"); 25 if (hasBeenInvoked()) buffer.append(" and has been invoked"); 26 return buffer; 27 } 28 } 29 | Popular Tags |