| 59 | } |
| 60 | |
| 61 | public void ReadTestsFromFile(string filename) |
| 62 | { |
| 63 | try |
| 64 | { |
| 65 | using (var reader = new StreamReader(filename)) |
| 66 | { |
| 67 | string line; |
| 68 | while ((line = reader.ReadLine()) != null) |
| 69 | { |
| 70 | if (string.IsNullOrWhiteSpace(line)) continue; |
| 71 | string query = line; |
| 72 | var results = new List<string[]>(); |
| 73 | while ((line = reader.ReadLine()) != null && !string.IsNullOrWhiteSpace(line)) |
| 74 | { |
| 75 | results.Add(line.Split(',')); |
| 76 | } |
| 77 | string[][] expectedResults = results.ToArray(); |
| 78 | AddTest(query, expectedResults); |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | catch (IOException e) |
| 83 | { |
| 84 | Console.Error.WriteLine(e.Message); |
| 85 | Environment.Exit(1); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | public class Test |
| 90 | { |