Created
January 10, 2014 04:07
-
-
Save tarynsauer/8346853 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private UI ui; | |
| private MockPrintStream printStream; | |
| @Before | |
| public void setUp() { | |
| MockOutputStream outputStream = new MockOutputStream(); | |
| printStream = new MockPrintStream(outputStream); | |
| printStream.setPrintCallHistory(new ArrayList<String>()); | |
| ui = new UI(printStream); | |
| } | |
| @Test | |
| public void testGetNextMove() { | |
| MockBufferedReader bufferedReader = new MockBufferedReader(new InputStreamReader(ui.input)); | |
| ui.setBufferedReader(bufferedReader); | |
| ArrayList<String> inputArray = new ArrayList<String>(); | |
| inputArray.add("1"); | |
| bufferedReader.setInputHistory(inputArray); | |
| assertEquals("1", ui.getNextMove()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment