@@ -13,6 +13,7 @@ namespace CodeOfChaos.Testing.TUnit;
1313// ---------------------------------------------------------------------------------------------------------------------
1414// Code
1515// ---------------------------------------------------------------------------------------------------------------------
16+ // ReSharper disable once InconsistentNaming
1617public static class TUnitExtensionsDiagnosticsImmutableArray {
1718 public static InvokableValueAssertionBuilder < ImmutableArray < Diagnostic > > ContainsDiagnostic ( this IValueSource < ImmutableArray < Diagnostic > > valueSource , string expectedId , [ CallerArgumentExpression ( nameof ( expectedId ) ) ] string doNotPopulateThisValue1 = "" ) {
1819 return valueSource . RegisterAssertion (
@@ -23,4 +24,24 @@ public static InvokableValueAssertionBuilder<ImmutableArray<Diagnostic>> Contain
2324 argumentExpressions : [ doNotPopulateThisValue1 ]
2425 ) ;
2526 }
27+
28+ public static InvokableValueAssertionBuilder < ImmutableArray < Diagnostic > > DoesNotContainDiagnostic ( this IValueSource < ImmutableArray < Diagnostic > > valueSource , string expectedId , [ CallerArgumentExpression ( nameof ( expectedId ) ) ] string doNotPopulateThisValue1 = "" ) {
29+ return valueSource . RegisterAssertion (
30+ assertCondition : new DoesNotContainDiagnosticAssertCondition < ImmutableArray < Diagnostic > > (
31+ static diagnostics => diagnostics ,
32+ expectedId
33+ ) ,
34+ argumentExpressions : [ doNotPopulateThisValue1 ]
35+ ) ;
36+ }
37+
38+ public static InvokableValueAssertionBuilder < ImmutableArray < Diagnostic > > ContainsDiagnosticsExclusively ( this IValueSource < ImmutableArray < Diagnostic > > valueSource , string [ ] expectedIds , [ CallerArgumentExpression ( nameof ( expectedIds ) ) ] string doNotPopulateThisValue1 = "" ) {
39+ return valueSource . RegisterAssertion (
40+ assertCondition : new ContainsDiagnosticsExclusivelyAssertCondition < ImmutableArray < Diagnostic > > (
41+ static diagnostics => diagnostics ,
42+ expectedIds
43+ ) ,
44+ argumentExpressions : [ doNotPopulateThisValue1 ]
45+ ) ;
46+ }
2647}
0 commit comments