Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject Out Of #1

Open
jameskennard opened this issue Mar 24, 2013 · 0 comments
Open

Inject Out Of #1

jameskennard opened this issue Mar 24, 2013 · 0 comments

Comments

@jameskennard
Copy link
Owner

Mockito-Collections is primarily aimed at injecting Collections of Mocks into an Object that is under test. We could potentially consider reversing this as well, for example given the annotation InjectOutOf:

@InjectMocks
private MyDelegate delegate;

@InjectOutOf
private Collection<MyListener> listeners;

@Test
public void shouldAdd() {
    // Given
    MyListener listener = mock(MyListener.class);

    // When
    delegate.add(listener);

    // Then
    // assertTrue(listeners.contains(listener));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant