@@ -310,6 +310,32 @@ public void AssertIsNotInstanceOfType_TestCodeFix(string oldAssertion, string ne
310
310
public void AssertObjectAreEqual_TestCodeFix ( string oldAssertion , string newAssertion )
311
311
=> VerifyCSharpFix < AssertAreEqualCodeFix , AssertAreEqualAnalyzer > ( "object actual, object expected" , oldAssertion , newAssertion ) ;
312
312
313
+ [ AssertionDataTestMethod ]
314
+ [ AssertionDiagnostic ( "Assert.AreEqual(expected, actual{0});" ) ]
315
+ [ Implemented ]
316
+ public void AssertOptionalIntAreEqual_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic < AssertAreEqualAnalyzer > ( "int? actual, int? expected" , assertion ) ;
317
+
318
+ [ AssertionDataTestMethod ]
319
+ [ AssertionCodeFix (
320
+ oldAssertion : "Assert.AreEqual(expected, actual{0});" ,
321
+ newAssertion : "actual.Should().Be(expected{0});" ) ]
322
+ [ Implemented ]
323
+ public void AssertOptionalIntAreEqual_TestCodeFix ( string oldAssertion , string newAssertion )
324
+ => VerifyCSharpFix < AssertAreEqualCodeFix , AssertAreEqualAnalyzer > ( "int? actual, int? expected" , oldAssertion , newAssertion ) ;
325
+
326
+ [ AssertionDataTestMethod ]
327
+ [ AssertionDiagnostic ( "Assert.AreEqual(actual, null{0});" ) ]
328
+ [ Implemented ]
329
+ public void AssertOptionalIntAndNullAreEqual_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic < AssertAreEqualAnalyzer > ( "int? actual" , assertion ) ;
330
+
331
+ [ AssertionDataTestMethod ]
332
+ [ AssertionCodeFix (
333
+ oldAssertion : "Assert.AreEqual(actual, null{0});" ,
334
+ newAssertion : "actual.Should().BeNull({0});" ) ]
335
+ [ Implemented ]
336
+ public void AssertOptionalIntAndNullAreEqual_TestCodeFix ( string oldAssertion , string newAssertion )
337
+ => VerifyCSharpFix < AssertAreEqualCodeFix , AssertAreEqualAnalyzer > ( "int? actual" , oldAssertion , newAssertion ) ;
338
+
313
339
[ AssertionDataTestMethod ]
314
340
[ AssertionDiagnostic ( "Assert.AreEqual(expected, actual, delta{0});" ) ]
315
341
[ AssertionDiagnostic ( "Assert.AreEqual(expected, actual, 0.6{0});" ) ]
@@ -403,6 +429,33 @@ public void AssertObjectAreNotEqual_TestCodeFix(string oldAssertion, string newA
403
429
public void AssertDoubleAreNotEqual_TestCodeFix ( string oldAssertion , string newAssertion )
404
430
=> VerifyCSharpFix < AssertAreNotEqualCodeFix , AssertAreNotEqualAnalyzer > ( "double actual, double expected, double delta" , oldAssertion , newAssertion ) ;
405
431
432
+
433
+ [ AssertionDataTestMethod ]
434
+ [ AssertionDiagnostic ( "Assert.AreNotEqual(expected, actual{0});" ) ]
435
+ [ Implemented ]
436
+ public void AssertOptionalIntAreNotEqual_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic < AssertAreNotEqualAnalyzer > ( "int? actual, int? expected" , assertion ) ;
437
+
438
+ [ AssertionDataTestMethod ]
439
+ [ AssertionCodeFix (
440
+ oldAssertion : "Assert.AreNotEqual(expected, actual{0});" ,
441
+ newAssertion : "actual.Should().NotBe(expected{0});" ) ]
442
+ [ Implemented ]
443
+ public void AssertOptionalIntAreNotEqual_TestCodeFix ( string oldAssertion , string newAssertion )
444
+ => VerifyCSharpFix < AssertAreNotEqualCodeFix , AssertAreNotEqualAnalyzer > ( "int? actual, int? expected" , oldAssertion , newAssertion ) ;
445
+
446
+ [ AssertionDataTestMethod ]
447
+ [ AssertionDiagnostic ( "Assert.AreNotEqual(actual, null{0});" ) ]
448
+ [ Implemented ]
449
+ public void AssertOptionalIntAndNullAreNotEqual_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic < AssertAreNotEqualAnalyzer > ( "int? actual" , assertion ) ;
450
+
451
+ [ AssertionDataTestMethod ]
452
+ [ AssertionCodeFix (
453
+ oldAssertion : "Assert.AreNotEqual(actual, null{0});" ,
454
+ newAssertion : "actual.Should().NotBeNull({0});" ) ]
455
+ [ Implemented ]
456
+ public void AssertOptionalIntAndNullAreNotEqual_TestCodeFix ( string oldAssertion , string newAssertion )
457
+ => VerifyCSharpFix < AssertAreNotEqualCodeFix , AssertAreNotEqualAnalyzer > ( "int? actual" , oldAssertion , newAssertion ) ;
458
+
406
459
[ AssertionDataTestMethod ]
407
460
[ AssertionDiagnostic ( "Assert.AreNotEqual(expected, actual, delta{0});" ) ]
408
461
[ AssertionDiagnostic ( "Assert.AreNotEqual(expected, actual, 0.6f{0});" ) ]
0 commit comments