Add simple test
This commit is contained in:
parent
2c4eb6c1f5
commit
9fb4a077cb
@ -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))]
|
||||||
@ -28,12 +59,12 @@ public class FileNameGenerator : IEnumerable<object[]>
|
|||||||
{
|
{
|
||||||
private readonly string inputFolder = @"..\..\..\Input";
|
private readonly string inputFolder = @"..\..\..\Input";
|
||||||
public IEnumerator<object[]> GetEnumerator()
|
public IEnumerator<object[]> GetEnumerator()
|
||||||
{
|
{
|
||||||
foreach (var input in Directory.GetFiles(inputFolder))
|
foreach (var input in Directory.GetFiles(inputFolder))
|
||||||
{
|
{
|
||||||
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 };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user