@@ -919,12 +919,14 @@ public void Nunit4_AssertLessOrEqual_TestCodeFix(string oldAssertion, string new
919
919
920
920
[ DataTestMethod ]
921
921
[ AssertionDiagnostic ( "Assert.AreEqual(expected, actual, delta{0});" ) ]
922
+ [ AssertionDiagnostic ( "Assert.AreEqual(actual, 4.2d, delta{0});" ) ]
922
923
[ Implemented ]
923
924
public void Nunit3_AssertEqualDouble_TestAnalyzer ( string assertion )
924
925
=> Nunit3VerifyDiagnostic ( "double expected, double actual, double delta" , assertion ) ;
925
926
926
927
[ DataTestMethod ]
927
928
[ AssertionDiagnostic ( "ClassicAssert.AreEqual(expected, actual, delta{0});" ) ]
929
+ [ AssertionDiagnostic ( "ClassicAssert.AreEqual(actual, 4.2d, delta{0});" ) ]
928
930
[ Implemented ]
929
931
public void Nunit4_AssertEqualDouble_TestAnalyzer ( string assertion )
930
932
=> Nunit4VerifyDiagnostic ( "double expected, double actual, double delta" , assertion ) ;
@@ -933,6 +935,9 @@ public void Nunit4_AssertEqualDouble_TestAnalyzer(string assertion)
933
935
[ AssertionCodeFix (
934
936
oldAssertion : "Assert.AreEqual(expected, actual, delta{0});" ,
935
937
newAssertion : "actual.Should().BeApproximately(expected, delta{0});" ) ]
938
+ [ AssertionCodeFix (
939
+ oldAssertion : "Assert.AreEqual(actual, 4.2d, delta{0});" ,
940
+ newAssertion : "actual.Should().BeApproximately(4.2d, delta{0});" ) ]
936
941
[ Implemented ]
937
942
public void Nunit3_AssertEqualDouble_TestCodeFix ( string oldAssertion , string newAssertion )
938
943
=> Nunit3VerifyFix ( "double expected, double actual, double delta" , oldAssertion , newAssertion ) ;
@@ -941,18 +946,23 @@ public void Nunit3_AssertEqualDouble_TestCodeFix(string oldAssertion, string new
941
946
[ AssertionCodeFix (
942
947
oldAssertion : "ClassicAssert.AreEqual(expected, actual, delta{0});" ,
943
948
newAssertion : "actual.Should().BeApproximately(expected, delta{0});" ) ]
949
+ [ AssertionCodeFix (
950
+ oldAssertion : "ClassicAssert.AreEqual(actual, 4.2d, delta{0});" ,
951
+ newAssertion : "actual.Should().BeApproximately(4.2d, delta{0});" ) ]
944
952
[ Implemented ]
945
953
public void Nunit4_AssertEqualDouble_TestCodeFix ( string oldAssertion , string newAssertion )
946
954
=> Nunit4VerifyFix ( "double expected, double actual, double delta" , oldAssertion , newAssertion ) ;
947
955
948
956
[ DataTestMethod ]
949
957
[ AssertionDiagnostic ( "Assert.AreEqual(expected, actual{0});" ) ]
958
+ [ AssertionDiagnostic ( "Assert.AreEqual(actual, \" foo\" {0});" ) ]
950
959
[ Implemented ]
951
960
public void Nunit3_AssertEqualObject_TestAnalyzer ( string assertion )
952
961
=> Nunit3VerifyDiagnostic ( "object expected, object actual" , assertion ) ;
953
962
954
963
[ DataTestMethod ]
955
964
[ AssertionDiagnostic ( "ClassicAssert.AreEqual(expected, actual{0});" ) ]
965
+ [ AssertionDiagnostic ( "ClassicAssert.AreEqual(actual, \" foo\" {0});" ) ]
956
966
[ Implemented ]
957
967
public void Nunit4_AssertEqualObject_TestAnalyzer ( string assertion )
958
968
=> Nunit4VerifyDiagnostic ( "object expected, object actual" , assertion ) ;
@@ -961,6 +971,9 @@ public void Nunit4_AssertEqualObject_TestAnalyzer(string assertion)
961
971
[ AssertionCodeFix (
962
972
oldAssertion : "Assert.AreEqual(expected, actual{0});" ,
963
973
newAssertion : "actual.Should().Be(expected{0});" ) ]
974
+ [ AssertionCodeFix (
975
+ oldAssertion : "Assert.AreEqual(actual, \" foo\" {0});" ,
976
+ newAssertion : "actual.Should().Be(\" foo\" {0});" ) ]
964
977
[ Implemented ]
965
978
public void Nunit3_AssertEqualObject_TestCodeFix ( string oldAssertion , string newAssertion )
966
979
=> Nunit3VerifyFix ( "object expected, object actual" , oldAssertion , newAssertion ) ;
@@ -969,18 +982,23 @@ public void Nunit3_AssertEqualObject_TestCodeFix(string oldAssertion, string new
969
982
[ AssertionCodeFix (
970
983
oldAssertion : "ClassicAssert.AreEqual(expected, actual{0});" ,
971
984
newAssertion : "actual.Should().Be(expected{0});" ) ]
985
+ [ AssertionCodeFix (
986
+ oldAssertion : "ClassicAssert.AreEqual(actual, \" foo\" {0});" ,
987
+ newAssertion : "actual.Should().Be(\" foo\" {0});" ) ]
972
988
[ Implemented ]
973
989
public void Nunit4_AssertEqualObject_TestCodeFix ( string oldAssertion , string newAssertion )
974
990
=> Nunit4VerifyFix ( "object expected, object actual" , oldAssertion , newAssertion ) ;
975
991
976
992
[ DataTestMethod ]
977
993
[ AssertionDiagnostic ( "Assert.AreNotEqual(expected, actual{0});" ) ]
994
+ [ AssertionDiagnostic ( "Assert.AreNotEqual(actual, \" foo\" {0});" ) ]
978
995
[ Implemented ]
979
996
public void Nunit3_AssertNotEqualObject_TestAnalyzer ( string assertion )
980
997
=> Nunit3VerifyDiagnostic ( "object expected, object actual" , assertion ) ;
981
998
982
999
[ DataTestMethod ]
983
1000
[ AssertionDiagnostic ( "ClassicAssert.AreNotEqual(expected, actual{0});" ) ]
1001
+ [ AssertionDiagnostic ( "ClassicAssert.AreNotEqual(actual, \" foo\" {0});" ) ]
984
1002
[ Implemented ]
985
1003
public void Nunit4_AssertNotEqualObject_TestAnalyzer ( string assertion )
986
1004
=> Nunit4VerifyDiagnostic ( "object expected, object actual" , assertion ) ;
@@ -989,6 +1007,9 @@ public void Nunit4_AssertNotEqualObject_TestAnalyzer(string assertion)
989
1007
[ AssertionCodeFix (
990
1008
oldAssertion : "Assert.AreNotEqual(expected, actual{0});" ,
991
1009
newAssertion : "actual.Should().NotBe(expected{0});" ) ]
1010
+ [ AssertionCodeFix (
1011
+ oldAssertion : "Assert.AreNotEqual(actual, \" foo\" {0});" ,
1012
+ newAssertion : "actual.Should().NotBe(\" foo\" {0});" ) ]
992
1013
[ Implemented ]
993
1014
public void Nunit3_AssertNotEqualObject_TestCodeFix ( string oldAssertion , string newAssertion )
994
1015
=> Nunit3VerifyFix ( "object expected, object actual" , oldAssertion , newAssertion ) ;
@@ -997,6 +1018,9 @@ public void Nunit3_AssertNotEqualObject_TestCodeFix(string oldAssertion, string
997
1018
[ AssertionCodeFix (
998
1019
oldAssertion : "ClassicAssert.AreNotEqual(expected, actual{0});" ,
999
1020
newAssertion : "actual.Should().NotBe(expected{0});" ) ]
1021
+ [ AssertionCodeFix (
1022
+ oldAssertion : "ClassicAssert.AreNotEqual(actual, \" foo\" {0});" ,
1023
+ newAssertion : "actual.Should().NotBe(\" foo\" {0});" ) ]
1000
1024
[ Implemented ]
1001
1025
public void Nunit4_AssertNotEqualObject_TestCodeFix ( string oldAssertion , string newAssertion )
1002
1026
=> Nunit4VerifyFix ( "object expected, object actual" , oldAssertion , newAssertion ) ;
0 commit comments