Add proper unit tests for dependency-injection pattern
This commit is contained in:
committed by
Jeroen Meulemeester
parent
0643289c74
commit
29fc56002a
@ -0,0 +1,33 @@
|
||||
package com.iluwatar.dependency.injection;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.PrintStream;
|
||||
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
|
||||
/**
|
||||
* Date: 12/10/15 - 8:26 PM
|
||||
*
|
||||
* @author Jeroen Meulemeester
|
||||
*/
|
||||
public class SimpleWizardTest extends StdOutTest {
|
||||
|
||||
/**
|
||||
* Test if the {@link SimpleWizard} does the only thing it can do: Smoke it's {@link
|
||||
* OldTobyTobacco}
|
||||
*/
|
||||
@Test
|
||||
public void testSmoke() {
|
||||
final SimpleWizard simpleWizard = new SimpleWizard();
|
||||
simpleWizard.smoke();
|
||||
verify(getStdOutMock(), times(1)).println("SimpleWizard smoking OldTobyTobacco");
|
||||
verifyNoMoreInteractions(getStdOutMock());
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user