package test.p048;
import static org.junit.Assert.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.PrintStream;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import main.p048.Main;
public class MainTest extends Main {
private final ByteArrayOutputStream outContent = new ByteArrayOutputStream();
private final PrintStream originalOut = System.out;
@BeforeEach
public void setUpStreams() {
System.setOut(new PrintStream(outContent));
}
@Test
void testMain1() throws Exception {
String data = "1";
InputStream stdin = System.in;
System.setIn(new ByteArrayInputStream(data.getBytes()));
Main.main(null);
assertEquals("2\r\n", outContent.toString());
}
@AfterEach
public void restoreStreams() {
System.setOut(originalOut);
}
}