package fi.helsinki.cs.tmc.cli.io;

import static org.junit.Assert.assertTrue;

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

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

public class TerminalIoTest {

    Io io = new TerminalIo();
    OutputStream os;

    @Before
    public void setUp() {
        os = new ByteArrayOutputStream();
        PrintStream ps = new PrintStream(os);
        System.setOut(ps);
    }

    @Test
    public void printlnWorksRight() {
        io.println("foo");
        assertTrue(os.toString().equals("foo\n"));
    }
}

@@ -496,98 +496,461 @@
 rint
-ln
 Wor
-ksRight() %7B%0A        io.println(%22foo%22);%0A        assertTrue(os.toString().equals(%22foo%5Cn
+d() %7B%0A        io.print(%22foo%22);%0A        assertTrue(os.toString().equals(%22foo%22));%0A    %7D%0A%0A    @Test%0A    public void printLineWithNewLine() %7B%0A        io.println(%22foo%22);%0A        assertTrue(os.toString().equals(%22foo%5Cn%22));%0A    %7D%0A%0A    @Test%0A    public void printNull() %7B%0A        io.print(null);%0A        assertTrue(os.toString().equals(%22null%22));%0A    %7D%0A%0A    @Test%0A    public void printInteger() %7B%0A        io.print(5);%0A        assertTrue(os.toString().equals(%225
 %22));

Add more terminal io tests.