Examples of MethodNameMatcher


Examples of org.jmock.core.matcher.MethodNameMatcher

                                                     InvocationMatcher arguments,
                                                     Stub stub )
    {
        InvocationMocker invocationMocker = new InvocationMocker(NO_DESCRIPTION);

        invocationMocker.addMatcher(new MethodNameMatcher(methodName));
        invocationMocker.addMatcher(arguments);
        invocationMocker.setStub(stub);

        return invocationMocker;
    }
View Full Code Here

Examples of org.jmock.internal.matcher.MethodNameMatcher

        expectation.setMethodMatcher(methodMatcher);
        return this;
    }
   
    public ParametersClause method(String nameRegex) {
        return method(new MethodNameMatcher(nameRegex));
    }
View Full Code Here

Examples of org.jmock.internal.matcher.MethodNameMatcher

        expectation.setMethodMatcher(methodMatcher);
        return this;
    }
   
    public ParametersClause method(String nameRegex) {
        return method(new MethodNameMatcher(nameRegex));
    }
View Full Code Here

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

Examples of org.jmock.matcher.MethodNameMatcher

    }

    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

Examples of org.jmock.matcher.MethodNameMatcher

    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
Copyright © 2018 www.massapi.com. 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.