@@ -18,14 +18,15 @@ public class NullConditionalAssertionTests
18
18
public void NullConditionalMayNotExecuteTest ( string assertion )
19
19
{
20
20
DiagnosticVerifier . VerifyDiagnostic ( new DiagnosticVerifierArguments ( )
21
- . WithDiagnosticAnalyzer < NullConditionalAssertionAnalyzer > ( )
21
+ . WithDiagnosticAnalyzer < FluentAssertionsOperationAnalyzer > ( )
22
22
. WithSources ( Code ( assertion ) )
23
23
. WithPackageReferences ( PackageReference . FluentAssertions_6_12_0 )
24
24
. WithExpectedDiagnostics ( new DiagnosticResult
25
25
{
26
- Id = NullConditionalAssertionAnalyzer . DiagnosticId ,
27
- Message = NullConditionalAssertionAnalyzer . Message ,
28
- Severity = Microsoft . CodeAnalysis . DiagnosticSeverity . Warning ,
26
+ Id = FluentAssertionsOperationAnalyzer . DiagnosticId ,
27
+ Message = DiagnosticMetadata . NullConditionalMayNotExecute . Message ,
28
+ Severity = Microsoft . CodeAnalysis . DiagnosticSeverity . Info , // TODO: change to warning
29
+ VisitorName = nameof ( DiagnosticMetadata . NullConditionalMayNotExecute ) ,
29
30
Locations = new DiagnosticResultLocation [ ]
30
31
{
31
32
new DiagnosticResultLocation ( "Test0.cs" , 11 , 13 )
@@ -37,12 +38,12 @@ public void NullConditionalMayNotExecuteTest(string assertion)
37
38
[ DataTestMethod ]
38
39
[ AssertionDiagnostic ( "(actual?.MyProperty).Should().Be(\" test\" {0});" ) ]
39
40
[ AssertionDiagnostic ( "actual.MyProperty.Should().Be(actual?.MyProperty{0});" ) ]
40
- [ AssertionDiagnostic ( "actual.MyList.Where(obj => obj?.ToString() == null).Count(). Should().Be(0 {0});" ) ]
41
+ [ AssertionDiagnostic ( "actual.MyList.Where(obj => obj?.ToString() == null).Should().HaveCount(6 {0});" ) ]
41
42
[ Implemented ]
42
43
public void NullConditionalWillStillExecuteTest ( string assertion )
43
44
{
44
45
DiagnosticVerifier . VerifyDiagnostic ( new DiagnosticVerifierArguments ( )
45
- . WithDiagnosticAnalyzer < NullConditionalAssertionAnalyzer > ( )
46
+ . WithDiagnosticAnalyzer < FluentAssertionsOperationAnalyzer > ( )
46
47
. WithSources ( Code ( assertion ) )
47
48
. WithPackageReferences ( PackageReference . FluentAssertions_6_12_0 )
48
49
) ;
0 commit comments