11using Codeuctivity ;
22using System ;
33using System . Collections . Generic ;
4- using System . Globalization ;
54using System . IO ;
65using System . Linq ;
76using System . Runtime . InteropServices ;
@@ -229,8 +228,9 @@ public static async Task ShouldNotDeadlockWhenValidatingFolderThatCausesLargeOut
229228 var pdfAValidator = new PdfAValidator ( ) ;
230229 var task = pdfAValidator . ValidateWithDetailedReportAsync ( tmpDirName , "" ) ;
231230
232- bool completedTask = task . Wait ( TimeSpan . FromMinutes ( 1 ) ) ;
231+ var completedTask = task . Wait ( TimeSpan . FromMinutes ( 1 ) ) ;
233232 Assert . True ( completedTask ) ;
233+
234234 if ( completedTask )
235235 {
236236 var result = await task ;
@@ -308,12 +308,7 @@ public static async Task ShouldThrowPathTooLongException()
308308 [ Fact ]
309309 public static async Task ShouldThrowExplainableExceptionOnTooLongCommandLineOnWindows ( )
310310 {
311- var expectedLocalizedMessage = "The command line is too long." ;
312-
313- if ( CultureInfo . InstalledUICulture . Name . StartsWith ( "de" ) )
314- {
315- expectedLocalizedMessage = "Die Befehlszeile ist zu lang." ;
316- }
311+ var expectedLocalizedMessages = new [ ] { "The command line is too long." , "Die Befehlszeile ist zu lang." } ;
317312
318313 if ( ! RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
319314 {
@@ -332,7 +327,8 @@ public static async Task ShouldThrowExplainableExceptionOnTooLongCommandLineOnWi
332327
333328 var actualException = await Assert . ThrowsAsync < VeraPdfException > ( ( ) => pdfAValidator . ValidateBatchWithDetailedReportAsync ( tooLongFileList , string . Empty ) ) ;
334329 Assert . Contains ( "Calling VeraPdf exited with 1 without any output." , actualException . Message ) ;
335- Assert . Contains ( expectedLocalizedMessage , actualException . Message ) ;
330+ var containsExpectedMessage = expectedLocalizedMessages . Any ( actualException . Message . Contains ) ;
331+ Assert . True ( containsExpectedMessage , "The exception message does not contain any of the expected localized messages." ) ;
336332 }
337333
338334 [ Fact ]
0 commit comments