1
0

Add simple test

This commit is contained in:
Serghei Cebotari 2023-08-11 08:04:22 +03:00
parent 2c4eb6c1f5
commit 9fb4a077cb

View File

@ -4,6 +4,37 @@ namespace Codeforces.Test;
public class Tests public class Tests
{ {
[Fact]
public void TestText()
{
IOTester.Start();
string[] input = new[]
{
"5",
"256 42",
"1000 1000",
"-1000 1000",
"-1000 1000",
"20 22"
};
IOTester.SetInput(input);
Program.Main();
string[] expectedOutput = new[]
{
"298",
"2000",
"0",
"0",
"42"
};
string[] actualOutput = IOTester.GetOutputLines();
Assert.Equal(expectedOutput.Length, actualOutput.Length);
for (int i = 0; i < expectedOutput.Length; i++)
{
Assert.Equal(expectedOutput[i], actualOutput[i]);
}
}
[Theory] [Theory]
[ClassData(typeof(FileNameGenerator))] [ClassData(typeof(FileNameGenerator))]
@ -33,7 +64,7 @@ public class FileNameGenerator : IEnumerable<object[]>
{ {
string name = Path.GetFileName(input); string name = Path.GetFileName(input);
string output = $"..\\..\\..\\Output\\{name}.a"; string output = $"..\\..\\..\\Output\\{name}.a";
yield return new object[] {input, output}; yield return new object[] { input, output };
} }
} }