File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/FluentAssertions.Analyzers.Tests/Tips Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ public class NullConditionalAssertionTests
99 {
1010 [ AssertionDataTestMethod ]
1111 [ AssertionDiagnostic ( "actual?.Should().Be(expected{0});" ) ]
12+ [ AssertionDiagnostic ( "actual?.MyProperty.Should().Be(\" test\" {0});" ) ]
13+ [ AssertionDiagnostic ( "actual.MyProperty?.Should().Be(\" test\" {0});" ) ]
1214 [ Implemented ]
1315 public void TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic ( assertion ) ;
1416
@@ -21,11 +23,15 @@ private void VerifyCSharpDiagnostic(string assertion)
2123 . AppendLine ( "{" )
2224 . AppendLine ( " class TestClass" )
2325 . AppendLine ( " {" )
24- . AppendLine ( " void TestMethod(int? actual, int expected)" )
26+ . AppendLine ( " void TestMethod(MyClass actual, MyClass expected)" )
2527 . AppendLine ( " {" )
2628 . AppendLine ( $ " { assertion } ")
2729 . AppendLine ( " }" )
2830 . AppendLine ( " }" )
31+ . AppendLine ( " class MyClass" )
32+ . AppendLine ( " {" )
33+ . AppendLine ( " public string MyProperty { get; set; }" )
34+ . AppendLine ( " }" )
2935 . AppendLine ( " class Program" )
3036 . AppendLine ( " {" )
3137 . AppendLine ( " public static void Main()" )
You can’t perform that action at this time.
0 commit comments