Move test data to files
This commit is contained in:
parent
48fa2c5533
commit
ded4e141ee
@ -6,34 +6,17 @@ public class Tests
|
|||||||
public void TestIO()
|
public void TestIO()
|
||||||
{
|
{
|
||||||
IOTester.Start();
|
IOTester.Start();
|
||||||
|
var lines = File.ReadLines(@"..\..\..\input.txt");
|
||||||
string[] input = new string[]
|
IOTester.SetInput(lines.ToArray());
|
||||||
{
|
|
||||||
"5",
|
|
||||||
"256 42",
|
|
||||||
"1000 1000",
|
|
||||||
"-1000 1000",
|
|
||||||
"-1000 1000",
|
|
||||||
"20 22"
|
|
||||||
};
|
|
||||||
IOTester.SetInput(input);
|
|
||||||
|
|
||||||
Program.Main();
|
Program.Main();
|
||||||
|
|
||||||
string[] output = new string[]
|
string[] expectedOutput = File.ReadLines(@"..\..\..\output.txt").ToArray();
|
||||||
{
|
|
||||||
"298",
|
|
||||||
"2000",
|
|
||||||
"0",
|
|
||||||
"0",
|
|
||||||
"42"
|
|
||||||
};
|
|
||||||
|
|
||||||
string[] actualOutput = IOTester.GetOutputLines();
|
string[] actualOutput = IOTester.GetOutputLines();
|
||||||
Assert.Equal(output.Length, actualOutput.Length);
|
Assert.Equal(expectedOutput.Length, actualOutput.Length);
|
||||||
for (int i = 0; i< output.Length; i++)
|
for (int i = 0; i < expectedOutput.Length; i++)
|
||||||
{
|
{
|
||||||
Assert.Equal(output[i], actualOutput[i]);
|
Assert.Equal(expectedOutput[i], actualOutput[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
6
Codeforces.Test/input.txt
Normal file
6
Codeforces.Test/input.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
5
|
||||||
|
256 42
|
||||||
|
1000 1000
|
||||||
|
-1000 1000
|
||||||
|
-1000 1000
|
||||||
|
20 22
|
5
Codeforces.Test/output.txt
Normal file
5
Codeforces.Test/output.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
298
|
||||||
|
2000
|
||||||
|
0
|
||||||
|
0
|
||||||
|
42
|
Loading…
Reference in New Issue
Block a user