aboutsummaryrefslogtreecommitdiff
path: root/Codeforces.Console/IOTester.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Codeforces.Console/IOTester.cs')
-rw-r--r--Codeforces.Console/IOTester.cs54
1 files changed, 0 insertions, 54 deletions
diff --git a/Codeforces.Console/IOTester.cs b/Codeforces.Console/IOTester.cs
deleted file mode 100644
index 8fdb931..0000000
--- a/Codeforces.Console/IOTester.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-namespace Codeforces
-{
- public class IOTester
- {
- private static readonly TextReader originalStdIn = Console.In;
- private static StringReader? stdIn;
-
- private static readonly TextWriter originalStdOut = Console.Out;
- private static StringWriter? stdOut;
-
- public static void Start()
- {
- stdOut = new StringWriter();
- Console.SetOut(stdOut);
- }
-
- public static void End()
- {
- stdOut = null;
- stdIn = null;
- Console.SetOut(originalStdOut);
- Console.SetIn(originalStdIn);
- }
-
- public static void SetInput(params string[] lines)
- {
- string input = string.Join(Environment.NewLine, lines);
- stdIn = new StringReader(input);
- Console.SetIn(stdIn);
- }
-
- public static string GetOutput()
- {
- if (stdOut == null)
- {
- return string.Empty;
- }
- else
- {
- return stdOut.ToString();
- }
- }
-
- public static string[] GetOutputLines()
- {
- return GetOutput().Split(Environment.NewLine).SkipLast(1).ToArray();
- }
-
- public static IList<string> GetOutputLinesAsList()
- {
- return new List<string>(GetOutputLines());
- }
- }
-} \ No newline at end of file