Package org.jmock.matcher

Examples of org.jmock.matcher.MethodNameMatcher


    }

    public void testMatchesInvocationWithParameters() {
        InvocationMocker invocationMocker = new InvocationMocker(
                new InvocationMatcher[]{
                    new MethodNameMatcher("example"),
                    new ArgumentsMatcher(new Constraint[]{C.eq("arg1"), C.eq("arg2")})}, null);

        assertTrue("Should have matched", invocationMocker.matches(exampleInvocation));
    }
View Full Code Here


    }

    public void testDoesNotMatchWithDifferentParameter() {
        InvocationMocker invocationMocker = new InvocationMocker(
                new InvocationMatcher[]{
                    new MethodNameMatcher("example"),
                    new ArgumentsMatcher(new Constraint[]{C.eq("arg1"), C.eq("not arg2")})}, null);

        assertFalse("Should not have matched", invocationMocker.matches(exampleInvocation));
    }
View Full Code Here

    private List matchers = new ArrayList();
    private Stub stub;

    public InvocationMocker(String methodName, InvocationMatcher arguments, Stub stub) {
        this(stub);
        addMatcher(new MethodNameMatcher(methodName));
        addMatcher(arguments);
    }
View Full Code Here

TOP

Related Classes of org.jmock.matcher.MethodNameMatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.