@@ -267,8 +267,9 @@ void AssertMatchesSnapshot((string Path, SourceText Text)[] sources,
267267
268268 var diagnostics = outputCompilation . GetDiagnostics ( ) ;
269269
270- Assert . False ( diagnostics . Any ( d => d . Severity == DiagnosticSeverity . Error ) ,
271- "Failed: " + diagnostics . FirstOrDefault ( ) ? . GetMessage ( ) ) ;
270+ Assert . That ( diagnostics . Any ( d => d . Severity == DiagnosticSeverity . Error ) ,
271+ Is . False ,
272+ "Failed: " + diagnostics . FirstOrDefault ( ) ? . GetMessage ( ) ) ;
272273
273274 var testPath = Path . Combine ( nameof ( SourceGeneratorTests ) , callerName ! ) ;
274275 var actualSourcesPath = Path . Combine ( TestContext . CurrentContext . WorkDirectory , testPath ) ;
@@ -601,14 +602,16 @@ internal static Assembly GenerateProgram(params (string Path, SourceText Text)[]
601602 out var outputCompilation ,
602603 out var generateDiagnostics ) ;
603604
604- Assert . False ( generateDiagnostics . Any ( d => d . Severity == DiagnosticSeverity . Error ) ,
605- "Failed: " + generateDiagnostics . FirstOrDefault ( ) ? . GetMessage ( ) ) ;
605+ Assert . That ( generateDiagnostics . Any ( d => d . Severity == DiagnosticSeverity . Error ) ,
606+ Is . False ,
607+ "Failed: " + generateDiagnostics . FirstOrDefault ( ) ? . GetMessage ( ) ) ;
606608
607609 using var ms = new MemoryStream ( ) ;
608610 var emitResult = outputCompilation . Emit ( ms ) ;
609611
610- Assert . False ( emitResult . Diagnostics . Any ( d => d . Severity == DiagnosticSeverity . Error ) ,
611- "Failed: " + emitResult . Diagnostics . FirstOrDefault ( ) ) ;
612+ Assert . That ( emitResult . Diagnostics . Any ( d => d . Severity == DiagnosticSeverity . Error ) ,
613+ Is . False ,
614+ "Failed: " + emitResult . Diagnostics . FirstOrDefault ( ) ) ;
612615
613616 ms . Position = 0 ;
614617
0 commit comments