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