@@ -410,7 +410,7 @@ public class OtherComponent
410
410
}
411
411
412
412
[ TestMethod ]
413
- [ NotImplemented ( Reason = "https://github.com/fluentassertions/fluentassertions.analyzers/issues/276" ) ]
413
+ [ Implemented ( Reason = "https://github.com/fluentassertions/fluentassertions.analyzers/issues/276" ) ]
414
414
public void ShouldNotFailToAnalyze2 ( )
415
415
{
416
416
const string source = @"
@@ -434,34 +434,18 @@ public class MyResponse
434
434
public IEnumerable<MyCollectionType>? MyCollection { get; set; }
435
435
}
436
436
public 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
- }
452
437
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 ( )
460
439
. WithSources ( source )
461
- . WithFixedSources ( fixedSource )
462
- . WithDiagnosticAnalyzer < FluentAssertionsOperationAnalyzer > ( )
463
- . WithCodeFixProvider < FluentAssertionsCodeFixProvider > ( )
440
+ . WithAllAnalyzers ( )
464
441
. 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
+ } )
465
449
) ;
466
450
}
467
451
}
0 commit comments