1
0

Move test data to files

This commit is contained in:
Serghei Cebotari 2023-08-09 17:06:42 +03:00
parent 48fa2c5533
commit ded4e141ee
3 changed files with 17 additions and 23 deletions

View File

@ -6,34 +6,17 @@ public class Tests
public void TestIO()
{
IOTester.Start();
string[] input = new string[]
{
"5",
"256 42",
"1000 1000",
"-1000 1000",
"-1000 1000",
"20 22"
};
IOTester.SetInput(input);
var lines = File.ReadLines(@"..\..\..\input.txt");
IOTester.SetInput(lines.ToArray());
Program.Main();
string[] output = new string[]
{
"298",
"2000",
"0",
"0",
"42"
};
string[] expectedOutput = File.ReadLines(@"..\..\..\output.txt").ToArray();
string[] actualOutput = IOTester.GetOutputLines();
Assert.Equal(output.Length, actualOutput.Length);
for (int i = 0; i< output.Length; i++)
Assert.Equal(expectedOutput.Length, actualOutput.Length);
for (int i = 0; i < expectedOutput.Length; i++)
{
Assert.Equal(output[i], actualOutput[i]);
Assert.Equal(expectedOutput[i], actualOutput[i]);
}
}
}

View File

@ -0,0 +1,6 @@
5
256 42
1000 1000
-1000 1000
-1000 1000
20 22

View File

@ -0,0 +1,5 @@
298
2000
0
0
42