Tests: Fix flaky tests when extracting table
All checks were successful
Test / Run tests (push) Successful in 2m10s
All checks were successful
Test / Run tests (push) Successful in 2m10s
This commit is contained in:
@ -19,7 +19,7 @@ namespace Tests.DocumentTests {
|
|||||||
Assert.That(table.Take(3), Is.EqualTo(new string[][] {
|
Assert.That(table.Take(3), Is.EqualTo(new string[][] {
|
||||||
["101 MUSTERMANN Max", "Winzerstraße 1", "2223", "Hohenruppersdorf", "0123463", "0", "Hohenruppersdorf"],
|
["101 MUSTERMANN Max", "Winzerstraße 1", "2223", "Hohenruppersdorf", "0123463", "0", "Hohenruppersdorf"],
|
||||||
["102 WEINBAUER Wernhardt", "Winzerstraße 2", "2223", "Hohenruppersdorf", "0123471", "0", "Hohenruppersdorf"],
|
["102 WEINBAUER Wernhardt", "Winzerstraße 2", "2223", "Hohenruppersdorf", "0123471", "0", "Hohenruppersdorf"],
|
||||||
["", "W&B Weinbauer GesbR", "Winzerstraße 2", "2223", "Hohenruppersdorf"],
|
[ "W&B Weinbauer GesbR", "Winzerstraße 2", "2223", "Hohenruppersdorf"],
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ namespace Tests.DocumentTests {
|
|||||||
|
|
||||||
public static string[][] ExtractTable(string text) {
|
public static string[][] ExtractTable(string text) {
|
||||||
return text.Split('\n')
|
return text.Split('\n')
|
||||||
.Select(row => Regex.Split(row, @"\s{2,}").Select(c => c.Trim()).ToArray())
|
.Select(row => Regex.Split(row, @"\s{2,}").Select(c => c.Trim()).Where(c => c.Length > 0).ToArray())
|
||||||
.Where(row => row.Length > 3)
|
.Where(row => row.Length > 3)
|
||||||
.Skip(1)
|
.Skip(1)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
Reference in New Issue
Block a user