Package org.mockito.internal.verification

Source Code of org.mockito.internal.verification.DefaultRegisteredInvocationsTest

/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/

package org.mockito.internal.verification;

import org.junit.Before;
import org.junit.Test;
import org.mockito.internal.invocation.InvocationBuilder;
import org.mockito.invocation.Invocation;
import org.mockitoutil.TestBase;

public class DefaultRegisteredInvocationsTest extends TestBase {
   
    private DefaultRegisteredInvocations invocations;
   
    @Before
    public void setup() {
        invocations = new DefaultRegisteredInvocations();
    }
   
    @Test
    public void should_not_return_to_string_method() throws Exception {
        Invocation toString = new InvocationBuilder().method("toString").toInvocation();
        Invocation simpleMethod = new InvocationBuilder().simpleMethod().toInvocation();
       
        invocations.add(toString);
        invocations.add(simpleMethod);
       
        assertTrue(invocations.getAll().contains(simpleMethod));
        assertFalse(invocations.getAll().contains(toString));
    }
}
TOP

Related Classes of org.mockito.internal.verification.DefaultRegisteredInvocationsTest

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.