@@ -0,0 +1,1994 @@
+package es.uniovi.asw;%0A%0Aimport es.uniovi.asw.model.Citizen;%0Aimport es.uniovi.asw.util.Console;%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0A%0Aimport java.io.ByteArrayInputStream;%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.PrintStream;%0Aimport java.util.Date;%0A%0Aimport static org.junit.Assert.*;%0A%0A%0A%0A/**%0A * Created by Pelayo Garcia Lartategui on 04/02/2017.%0A */%0Apublic class ConsoleTest %7B%0A%0A    private String newLine = System.getProperty(%22line.separator%22);//This will retrieve line separator dependent on OS.%0A    private final ByteArrayOutputStream outContent = new ByteArrayOutputStream();%0A    private  ByteArrayInputStream in;%0A    @Before%0A    public void setUp() throws Exception %7B%0A       in = new ByteArrayInputStream(%22test in%22.getBytes());%0A        System.setOut(new PrintStream(outContent));%0A        System.setIn(in);%0A%0A%0A    %7D%0A%0A    @After%0A    public void tearDown() throws Exception %7B%0A        System.setOut(null);%0A        System.setIn(System.in);%0A%0A    %7D%0A%0A    @Test%0A    public void println() throws Exception %7B%0A        Console.println(%22Test println%22);%0A        assertEquals(%22Test println%22+newLine,outContent.toString());%0A    %7D%0A%0A    @Test%0A    public void println1() throws Exception %7B%0A        Citizen c = new Citizen(%22Pelayo%22,%22Garcia%22,%22email@email.com%22,%0A                new Date(),%22Gijon%22,%22Espa%C3%B1ola%22,%22563587A%22);%0A        Console.println(c);%0A        assertEquals(c.toString()+newLine,outContent.toString());%0A%0A    %7D%0A%0A    @Test%0A    public void print() throws Exception %7B%0A        Console.print(%22Test println%22);%0A        assertEquals(%22Test println%22,outContent.toString());%0A%0A    %7D%0A%0A    @Test%0A    public void printf() throws Exception %7B%0A%0A        Console.printf(%22%25.2f%22, 12.3698);%0A        assertEquals(%2212,37%22,outContent.toString());%0A%0A    %7D%0A%0A%0A    @Test%0A    public void readString1() throws Exception %7B%0A%0A        String s = Console.readString(%22Test readString%22);%0A        assertEquals(%22test in%22,s);%0A        assertEquals(%22Test readString: %22,outContent.toString());%0A%0A%0A%0A    %7D%0A%0A%7D

Test Console