Tests: Use Assert.EnterMultipleScope instead of Assert.Multiple
Test / Run tests (push) Successful in 2m6s
Test / Run tests (push) Successful in 2m6s
This commit is contained in:
@@ -4,10 +4,13 @@ using NReco.PdfRenderer;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Tests.UnitTests.DocumentTests {
|
||||
public static class Utils {
|
||||
public static partial class Utils {
|
||||
|
||||
private static readonly string FileName = Path.Combine(Path.GetTempPath(), "test_document.pdf");
|
||||
|
||||
[GeneratedRegex(@"\s{2,}")]
|
||||
private static partial Regex WideSpaces();
|
||||
|
||||
public static async Task<string> GeneratePdfText(Document doc, bool preserveLayout = false) {
|
||||
using (var ctx = new AppDbContext()) {
|
||||
await doc.Generate(ctx);
|
||||
@@ -22,11 +25,10 @@ namespace Tests.UnitTests.DocumentTests {
|
||||
}
|
||||
|
||||
public static string[][] ExtractTable(string text) {
|
||||
return text.Split('\n')
|
||||
.Select(row => Regex.Split(row, @"\s{2,}").Select(c => c.Trim()).Where(c => c.Length > 0).ToArray())
|
||||
return [.. text.Split('\n')
|
||||
.Select(row => WideSpaces().Split(row).Select(c => c.Trim()).Where(c => c.Length > 0).ToArray())
|
||||
.Where(row => row.Length >= 3)
|
||||
.Skip(1)
|
||||
.ToArray();
|
||||
.Skip(1)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user