|
|
@ -19,7 +19,6 @@ namespace AOC2021.Test
|
|
|
|
Console.WriteLine($"Testing {request.Day} Part A, Test data");
|
|
|
|
Console.WriteLine($"Testing {request.Day} Part A, Test data");
|
|
|
|
if (!string.IsNullOrEmpty(request.Answer.Day_A_Test))
|
|
|
|
if (!string.IsNullOrEmpty(request.Answer.Day_A_Test))
|
|
|
|
response.Answer.Day_A_Test = GetAOCDay(request.Day).ExecuteDay(new AOCRequest() { Input = test, Version = AOCVersion.A }).Answer;
|
|
|
|
response.Answer.Day_A_Test = GetAOCDay(request.Day).ExecuteDay(new AOCRequest() { Input = test, Version = AOCVersion.A }).Answer;
|
|
|
|
Console.WriteLine(response);
|
|
|
|
|
|
|
|
Console.WriteLine(response.Answer.Day_A_Test);
|
|
|
|
Console.WriteLine(response.Answer.Day_A_Test);
|
|
|
|
Console.WriteLine($"Testing {request.Day} Part A, Input data");
|
|
|
|
Console.WriteLine($"Testing {request.Day} Part A, Input data");
|
|
|
|
if (!string.IsNullOrEmpty(request.Answer.Day_A_Input))
|
|
|
|
if (!string.IsNullOrEmpty(request.Answer.Day_A_Input))
|
|
|
@ -57,16 +56,18 @@ namespace AOC2021.Test
|
|
|
|
|
|
|
|
|
|
|
|
private string GetTextInput(string day, string type)
|
|
|
|
private string GetTextInput(string day, string type)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
var constructedFileName = $"Input\\{day}_{type}.txt";
|
|
|
|
|
|
|
|
Console.WriteLine("ConstructedFileName: " + constructedFileName);
|
|
|
|
|
|
|
|
Console.WriteLine("Input File Size: " + Directory.GetFiles("Input").Length);
|
|
|
|
foreach (var file in Directory.GetFiles("Input"))
|
|
|
|
foreach (var file in Directory.GetFiles("Input"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var constructedFileName = $"Input\\{day}_{type}.txt";
|
|
|
|
|
|
|
|
if (file.ToLower().Equals(constructedFileName.ToLower()))
|
|
|
|
if (file.ToLower().Equals(constructedFileName.ToLower()))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Console.WriteLine("Loading " + file);
|
|
|
|
Console.WriteLine("Loading " + file);
|
|
|
|
return File.ReadAllText(file);
|
|
|
|
return File.ReadAllText(file);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
throw new Exception($"No Text Input found for {day} {type}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|