@@ -322,33 +322,26 @@ public void AssertOptionalIntegerAreEqual_TestCodeFix(string oldAssertion, strin
322322
323323 [ DataTestMethod ]
324324 [ AssertionDiagnostic ( "Assert.AreEqual(actual, null{0});" ) ]
325+ [ AssertionDiagnostic ( "Assert.AreEqual(null, actual{0});" ) ]
325326 [ Implemented ]
326- public void AssertOptionalIntegerAndNullAreEqual1_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic ( "int? actual" , assertion ) ;
327+ public void AssertOptionalIntegerAndNullAreEqual_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic ( "int? actual" , assertion ) ;
327328
328329 [ DataTestMethod ]
329330 [ AssertionCodeFix (
330331 oldAssertion : "Assert.AreEqual(actual, null{0});" ,
331332 newAssertion : "actual.Should().BeNull({0});" ) ]
332- [ Implemented ]
333- public void AssertOptionalIntegerAndNullAreEqual1_TestCodeFix ( string oldAssertion , string newAssertion )
334- => VerifyCSharpFix ( "int? actual" , oldAssertion , newAssertion ) ;
335-
336- [ DataTestMethod ]
337- [ AssertionDiagnostic ( "Assert.AreEqual(null, actual{0});" ) ]
338- [ Implemented ]
339- public void AssertOptionalIntegerAndNullAreEqual2_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic ( "int? actual" , assertion ) ;
340-
341- [ DataTestMethod ]
342333 [ AssertionCodeFix (
343334 oldAssertion : "Assert.AreEqual(null, actual{0});" ,
344335 newAssertion : "actual.Should().BeNull({0});" ) ]
345336 [ Implemented ]
346- public void AssertOptionalIntegerAndNullAreEqual2_TestCodeFix ( string oldAssertion , string newAssertion )
337+ public void AssertOptionalIntegerAndNullAreEqual_TestCodeFix ( string oldAssertion , string newAssertion )
347338 => VerifyCSharpFix ( "int? actual" , oldAssertion , newAssertion ) ;
348339
349340 [ DataTestMethod ]
350341 [ AssertionDiagnostic ( "Assert.AreEqual(expected, actual, delta{0});" ) ]
351342 [ AssertionDiagnostic ( "Assert.AreEqual(expected, actual, 0.6{0});" ) ]
343+ [ AssertionDiagnostic ( "Assert.AreEqual(actual, 4.2d, 0.6{0});" ) ]
344+ [ AssertionDiagnostic ( "Assert.AreEqual(4.2d, actual, 0.6{0});" ) ]
352345 [ Implemented ]
353346 public void AssertDoubleAreEqual_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic ( "double actual, double expected, double delta" , assertion ) ;
354347
@@ -359,13 +352,21 @@ public void AssertOptionalIntegerAndNullAreEqual2_TestCodeFix(string oldAssertio
359352 [ AssertionCodeFix (
360353 oldAssertion : "Assert.AreEqual(expected, actual, 0.6{0});" ,
361354 newAssertion : "actual.Should().BeApproximately(expected, 0.6{0});" ) ]
355+ [ AssertionCodeFix (
356+ oldAssertion : "Assert.AreEqual(actual, 4.2d, 0.6{0});" ,
357+ newAssertion : "actual.Should().BeApproximately(4.2d, 0.6{0});" ) ]
358+ [ AssertionCodeFix (
359+ oldAssertion : "Assert.AreEqual(4.2d, actual, 0.6{0});" ,
360+ newAssertion : "actual.Should().BeApproximately(4.2d, 0.6{0});" ) ]
362361 [ Implemented ]
363362 public void AssertDoubleAreEqual_TestCodeFix ( string oldAssertion , string newAssertion )
364363 => VerifyCSharpFix ( "double actual, double expected, double delta" , oldAssertion , newAssertion ) ;
365364
366365 [ DataTestMethod ]
367366 [ AssertionDiagnostic ( "Assert.AreEqual(expected, actual, delta{0});" ) ]
368367 [ AssertionDiagnostic ( "Assert.AreEqual(expected, actual, 0.6f{0});" ) ]
368+ [ AssertionDiagnostic ( "Assert.AreEqual(actual, 4.2f, 0.6f{0});" ) ]
369+ [ AssertionDiagnostic ( "Assert.AreEqual(4.2f, actual, 0.6f{0});" ) ]
369370 [ Implemented ]
370371 public void AssertFloatAreEqual_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic ( "float actual, float expected, float delta" , assertion ) ;
371372
@@ -376,35 +377,81 @@ public void AssertDoubleAreEqual_TestCodeFix(string oldAssertion, string newAsse
376377 [ AssertionCodeFix (
377378 oldAssertion : "Assert.AreEqual(expected, actual, 0.6f{0});" ,
378379 newAssertion : "actual.Should().BeApproximately(expected, 0.6f{0});" ) ]
380+ [ AssertionCodeFix (
381+ oldAssertion : "Assert.AreEqual(actual, 4.2f, 0.6f{0});" ,
382+ newAssertion : "actual.Should().BeApproximately(4.2f, 0.6f{0});" ) ]
383+ [ AssertionCodeFix (
384+ oldAssertion : "Assert.AreEqual(4.2f, actual, 0.6f{0});" ,
385+ newAssertion : "actual.Should().BeApproximately(4.2f, 0.6f{0});" ) ]
379386 [ Implemented ]
380387 public void AssertFloatAreEqual_TestCodeFix ( string oldAssertion , string newAssertion )
381388 => VerifyCSharpFix ( "float actual, float expected, float delta" , oldAssertion , newAssertion ) ;
382389
383390 [ DataTestMethod ]
384391 [ AssertionDiagnostic ( "Assert.AreEqual(expected, actual{0});" ) ]
392+ [ AssertionDiagnostic ( "Assert.AreEqual(actual, \" literal\" {0});" ) ]
393+ [ AssertionDiagnostic ( "Assert.AreEqual(\" literal\" , actual{0});" ) ]
385394 [ AssertionDiagnostic ( "Assert.AreEqual(expected, actual, false{0});" ) ]
395+ [ AssertionDiagnostic ( "Assert.AreEqual(actual, \" literal\" , false{0});" ) ]
396+ [ AssertionDiagnostic ( "Assert.AreEqual(\" literal\" , actual, false{0});" ) ]
386397 [ AssertionDiagnostic ( "Assert.AreEqual(expected, actual, true{0});" ) ]
398+ [ AssertionDiagnostic ( "Assert.AreEqual(actual, \" literal\" , true{0});" ) ]
399+ [ AssertionDiagnostic ( "Assert.AreEqual(\" literal\" , actual, true{0});" ) ]
387400 [ AssertionDiagnostic ( "Assert.AreEqual(expected, actual, false, System.Globalization.CultureInfo.CurrentCulture{0});" ) ]
401+ [ AssertionDiagnostic ( "Assert.AreEqual(actual, \" literal\" , false, System.Globalization.CultureInfo.CurrentCulture{0});" ) ]
402+ [ AssertionDiagnostic ( "Assert.AreEqual(\" literal\" , actual, false, System.Globalization.CultureInfo.CurrentCulture{0});" ) ]
388403 [ AssertionDiagnostic ( "Assert.AreEqual(expected, actual, true, System.Globalization.CultureInfo.CurrentCulture{0});" ) ]
404+ [ AssertionDiagnostic ( "Assert.AreEqual(actual, \" literal\" , true, System.Globalization.CultureInfo.CurrentCulture{0});" ) ]
405+ [ AssertionDiagnostic ( "Assert.AreEqual(\" literal\" , actual, true, System.Globalization.CultureInfo.CurrentCulture{0});" ) ]
389406 [ Implemented ]
390407 public void AssertStringAreEqual_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic ( "string actual, string expected" , assertion ) ;
391408
392409 [ DataTestMethod ]
393410 [ AssertionCodeFix (
394411 oldAssertion : "Assert.AreEqual(expected, actual{0});" ,
395412 newAssertion : "actual.Should().Be(expected{0});" ) ]
413+ [ AssertionCodeFix (
414+ oldAssertion : "Assert.AreEqual(actual, \" literal\" {0});" ,
415+ newAssertion : "actual.Should().Be(\" literal\" {0});" ) ]
416+ [ AssertionCodeFix (
417+ oldAssertion : "Assert.AreEqual(\" literal\" , actual{0});" ,
418+ newAssertion : "actual.Should().Be(\" literal\" {0});" ) ]
396419 [ AssertionCodeFix (
397420 oldAssertion : "Assert.AreEqual(expected, actual, false{0});" ,
398421 newAssertion : "actual.Should().Be(expected{0});" ) ]
422+ [ AssertionCodeFix (
423+ oldAssertion : "Assert.AreEqual(actual, \" literal\" , false{0});" ,
424+ newAssertion : "actual.Should().Be(\" literal\" {0});" ) ]
425+ [ AssertionCodeFix (
426+ oldAssertion : "Assert.AreEqual(\" literal\" , actual, false{0});" ,
427+ newAssertion : "actual.Should().Be(\" literal\" {0});" ) ]
399428 [ AssertionCodeFix (
400429 oldAssertion : "Assert.AreEqual(expected, actual, true{0});" ,
401430 newAssertion : "actual.Should().BeEquivalentTo(expected{0});" ) ]
431+ [ AssertionCodeFix (
432+ oldAssertion : "Assert.AreEqual(actual, \" literal\" , true{0});" ,
433+ newAssertion : "actual.Should().BeEquivalentTo(\" literal\" {0});" ) ]
434+ [ AssertionCodeFix (
435+ oldAssertion : "Assert.AreEqual(\" literal\" , actual, true{0});" ,
436+ newAssertion : "actual.Should().BeEquivalentTo(\" literal\" {0});" ) ]
402437 [ AssertionCodeFix (
403438 oldAssertion : "Assert.AreEqual(expected, actual, false, System.Globalization.CultureInfo.CurrentCulture{0});" ,
404439 newAssertion : "actual.Should().Be(expected{0});" ) ]
440+ [ AssertionCodeFix (
441+ oldAssertion : "Assert.AreEqual(actual, \" literal\" , false, System.Globalization.CultureInfo.CurrentCulture{0});" ,
442+ newAssertion : "actual.Should().Be(\" literal\" {0});" ) ]
443+ [ AssertionCodeFix (
444+ oldAssertion : "Assert.AreEqual(\" literal\" , actual, false, System.Globalization.CultureInfo.CurrentCulture{0});" ,
445+ newAssertion : "actual.Should().Be(\" literal\" {0});" ) ]
405446 [ AssertionCodeFix (
406447 oldAssertion : "Assert.AreEqual(expected, actual, true, System.Globalization.CultureInfo.CurrentCulture{0});" ,
407448 newAssertion : "actual.Should().BeEquivalentTo(expected{0});" ) ]
449+ [ AssertionCodeFix (
450+ oldAssertion : "Assert.AreEqual(actual, \" literal\" , true, System.Globalization.CultureInfo.CurrentCulture{0});" ,
451+ newAssertion : "actual.Should().BeEquivalentTo(\" literal\" {0});" ) ]
452+ [ AssertionCodeFix (
453+ oldAssertion : "Assert.AreEqual(\" literal\" , actual, true, System.Globalization.CultureInfo.CurrentCulture{0});" ,
454+ newAssertion : "actual.Should().BeEquivalentTo(\" literal\" {0});" ) ]
408455 [ Implemented ]
409456 public void AssertStringAreEqual_TestCodeFix ( string oldAssertion , string newAssertion )
410457 => VerifyCSharpFix ( "string actual, string expected" , oldAssertion , newAssertion ) ;
@@ -455,20 +502,26 @@ public void AssertOptionalIntAreNotEqual_TestCodeFix(string oldAssertion, string
455502
456503 [ DataTestMethod ]
457504 [ AssertionDiagnostic ( "Assert.AreNotEqual(actual, null{0});" ) ]
505+ [ AssertionDiagnostic ( "Assert.AreNotEqual(null, actual{0});" ) ]
458506 [ Implemented ]
459507 public void AssertOptionalIntAndNullAreNotEqual_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic ( "int? actual" , assertion ) ;
460508
461509 [ DataTestMethod ]
462510 [ AssertionCodeFix (
463511 oldAssertion : "Assert.AreNotEqual(actual, null{0});" ,
464512 newAssertion : "actual.Should().NotBeNull({0});" ) ]
513+ [ AssertionCodeFix (
514+ oldAssertion : "Assert.AreNotEqual(null, actual{0});" ,
515+ newAssertion : "actual.Should().NotBeNull({0});" ) ]
465516 [ Implemented ]
466517 public void AssertOptionalIntAndNullAreNotEqual_TestCodeFix ( string oldAssertion , string newAssertion )
467518 => VerifyCSharpFix ( "int? actual" , oldAssertion , newAssertion ) ;
468519
469520 [ DataTestMethod ]
470521 [ AssertionDiagnostic ( "Assert.AreNotEqual(expected, actual, delta{0});" ) ]
471522 [ AssertionDiagnostic ( "Assert.AreNotEqual(expected, actual, 0.6f{0});" ) ]
523+ [ AssertionDiagnostic ( "Assert.AreNotEqual(actual, 4.2f, 0.6f{0});" ) ]
524+ [ AssertionDiagnostic ( "Assert.AreNotEqual(4.2f, actual, 0.6f{0});" ) ]
472525 [ Implemented ]
473526 public void AssertFloatAreNotEqual_TestAnalyzer ( string assertion ) => VerifyCSharpDiagnostic ( "float actual, float expected, float delta" , assertion ) ;
474527
@@ -479,6 +532,12 @@ public void AssertOptionalIntAndNullAreNotEqual_TestCodeFix(string oldAssertion,
479532 [ AssertionCodeFix (
480533 oldAssertion : "Assert.AreNotEqual(expected, actual, 0.6f{0});" ,
481534 newAssertion : "actual.Should().NotBeApproximately(expected, 0.6f{0});" ) ]
535+ [ AssertionCodeFix (
536+ oldAssertion : "Assert.AreNotEqual(actual, 4.2f, 0.6f{0});" ,
537+ newAssertion : "actual.Should().NotBeApproximately(4.2f, 0.6f{0});" ) ]
538+ [ AssertionCodeFix (
539+ oldAssertion : "Assert.AreNotEqual(4.2f, actual, 0.6f{0});" ,
540+ newAssertion : "actual.Should().NotBeApproximately(4.2f, 0.6f{0});" ) ]
482541 [ Implemented ]
483542 public void AssertFloatAreNotEqual_TestCodeFix ( string oldAssertion , string newAssertion )
484543 => VerifyCSharpFix ( "float actual, float expected, float delta" , oldAssertion , newAssertion ) ;
0 commit comments