package com.twu.biblioteca;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;

import static org.junit.Assert.assertEquals;


/**
 * Created by watsonarw on 16/04/15.
 */
public class MainMenuTest {

    private ByteArrayOutputStream outStream = new ByteArrayOutputStream();

    @Before
    public void setupStreams() {
        System.setOut(new PrintStream(outStream));
    }

    @After
    public void tearDown() {
        System.setOut(null);
    }

    @Test
    public void testDisplayMainMenu() {
        String expected = "------ Main Menu ------\n" +
                          "Select an option below:\n" +
                          " 1 | List Books\n";
        MainMenu menu = new MainMenu();
        menu.show();
        assertEquals(expected, outStream.toString());
    }
}

@@ -95,16 +95,53 @@
 .Test;%0A%0A
+import java.io.ByteArrayInputStream;%0A
 import j
@@ -162,32 +162,32 @@
 ayOutputStream;%0A
-
 import java.io.P
@@ -568,16 +568,49 @@
 (null);%0A
+        System.setIn(System.in);%0A
     %7D%0A%0A 
@@ -874,24 +874,24 @@
 enu.show();%0A
-
         asse
@@ -937,11 +937,463 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testSelectionOneShowsListOfBooks() %7B%0A        String expected = BibliotecaApp.getLibrary().getBookList();%0A        MainMenu menu = new MainMenu();%0A        nextInputAs(%221%5Cn%22);%0A        menu.handleResponse();%0A%0A        assertEquals(expected, outStream.toString());%0A    %7D%0A%0A    private void nextInputAs(String s) %7B%0A        ByteArrayInputStream inStream = new ByteArrayInputStream(s.getBytes());%0A        System.setIn(inStream);%0A    %7D
 %0A%7D%0A

Add test for handling input (not working)