use of org.evosuite.runtime.mock.java.io.MockPrintStream in project evosuite by EvoSuite.
the class CharByteReadWriteTest method testPrintStream.
@Test
public void testPrintStream() throws Throwable {
String file = "PrintStream_file.tmp";
String expected = "testPrintStream";
MockPrintStream out = new MockPrintStream(file);
out.println(expected);
out.close();
Scanner in = new Scanner(new MockFileInputStream(file));
String result = in.nextLine();
in.close();
Assert.assertEquals(expected, result);
}
Aggregations