package com.twu.biblioteca;


import org.junit.Test;

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

import static org.junit.Assert.assertEquals;

public class BibliotecaAppTest {

    @Test
    public void print_should_output_the_message() {
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        System.setOut(new PrintStream(outputStream));
        String message = "test";
        BibliotecaApp.print(message);
        assertEquals(message + '\n', outputStream.toString());
    }
}

@@ -23,16 +23,65 @@
 teca;%0A%0A%0A
+import org.junit.After;%0Aimport org.junit.Before;%0A
 import o
@@ -247,74 +247,8 @@
  %7B%0A%0A
-    @Test%0A    public void print_should_output_the_message() %7B%0A    
     
@@ -312,16 +312,55 @@
 tream();
+%0A%0A    @Before%0A    public void setUp() %7B
 %0A       
@@ -402,24 +402,93 @@
 utStream));%0A
+    %7D%0A%0A    @Test%0A    public void print_should_output_the_message() %7B%0A
         Stri
@@ -614,11 +614,495 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void main_should_output_correctly() %7B%0A        BibliotecaApp.main(new String%5B0%5D);%0A        String expectedOutput = String.join(%22%5Cn%22,%0A                %22Welcome to Biblioteca!%22,%0A                %22Book1%5CtAuthor1%5Ct2003%22,%0A                %22Book2%5CtAuthor2%5Ct2005%22,%0A                %22Book3%5CtAuthor3%5Ct2013%22%0A                ) + %22%5Cn%22;%0A        assertEquals(expectedOutput, outputStream.toString());%0A    %7D%0A%0A    @After%0A    public void clearUp() %7B%0A        System.setOut(null);%0A    %7D
 %0A%7D%0A

add main functional test