| /* |
| * 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; |
| |
| import static junit.framework.TestCase.assertFalse; |
| import static junit.framework.TestCase.assertTrue; |
| |
| 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)); |
| } |
| } |