@@ -410,7 +410,7 @@ public class OtherComponent
410410 }
411411
412412 [ TestMethod ]
413- [ NotImplemented ( Reason = "https://github.com/fluentassertions/fluentassertions.analyzers/issues/276" ) ]
413+ [ Implemented ( Reason = "https://github.com/fluentassertions/fluentassertions.analyzers/issues/276" ) ]
414414 public void ShouldNotFailToAnalyze2 ( )
415415 {
416416 const string source = @"
@@ -434,34 +434,18 @@ public class MyResponse
434434 public IEnumerable<MyCollectionType>? MyCollection { get; set; }
435435}
436436public class MyCollectionType { }" ;
437- const string fixedSource = @"
438- #nullable enable
439- using FluentAssertions;
440- using FluentAssertions.Extensions;
441- using System.Linq;
442- using System.Collections.Generic;
443-
444- public class TestClass
445- {
446- public static void Main()
447- {
448- var response = new MyResponse();
449- response.MyCollection?.Should().HaveCount(2);
450- }
451- }
452437
453- public class MyResponse
454- {
455- public IEnumerable<MyCollectionType>? MyCollection { get; set; }
456- }
457- public class MyCollectionType { }" ;
458-
459- DiagnosticVerifier . VerifyFix ( new CodeFixVerifierArguments ( )
438+ DiagnosticVerifier . VerifyDiagnostic ( new DiagnosticVerifierArguments ( )
460439 . WithSources ( source )
461- . WithFixedSources ( fixedSource )
462- . WithDiagnosticAnalyzer < FluentAssertionsOperationAnalyzer > ( )
463- . WithCodeFixProvider < FluentAssertionsCodeFixProvider > ( )
440+ . WithAllAnalyzers ( )
464441 . WithPackageReferences ( PackageReference . FluentAssertions_6_12_0 )
442+ . WithExpectedDiagnostics ( new DiagnosticResult ( )
443+ {
444+ Id = NullConditionalAssertionAnalyzer . DiagnosticId ,
445+ Message = NullConditionalAssertionAnalyzer . Message ,
446+ Severity = DiagnosticSeverity . Warning ,
447+ Locations = new [ ] { new DiagnosticResultLocation ( "Test0.cs" , 13 , 9 ) }
448+ } )
465449 ) ;
466450 }
467451 }
0 commit comments