@Test public void shouldReportErrorMessageWhenUserSelectsABookThatDoesNotExist() throws IOException { when(bufferedReader.readLine()).thenReturn("2", "100", "1", "0"); when(library.checkOutBook(99)).thenReturn(false); when(library.checkOutBook(0)).thenReturn(true); bookList.add(harryPotter); menu.respondToUserInput(library); verify(printStream).println(contains("That book is not available.")); }
private void successfullyReturnBook() throws IOException { when(bufferedReader.readLine()).thenReturn("2", "1", "0"); when(library.checkOutBook(0)).thenReturn(true); }