public void LogResult() { string result; if (FailedReason != "") { result = "Result: Failed: " + FailedReason; } else { result = "Result: Success"; } string statement = "Statement:\n" + FormatStatement(); List <string> lines = new List <string> { $"SqlTest: {Name}", result, statement }; lines.AddRange(ExpectedValues.ToList()); lines.Add(OutputTable.Aggregate("|", (current, t) => current + t.FormatHeader() + "|")); if (OutputTable.Count != 0) { for (int i = 0; i < OutputTable[0].Count; i++) { lines.Add(OutputTable.Aggregate("|", (current, t) => current + t.FormatValue(i) + "|")); } } Console.WriteLine($"Test: {Name}: {result.Replace("Result: ", "")}"); Logger.PrintLines(lines.ToArray(), "./Tests/" + Name + ".txt"); }