From 573ecf1d614388d9841e0ebe204bcf968484c3ee Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Mon, 29 Jul 2019 15:11:19 -0400 Subject: [PATCH] Re-enable xunit warning 2006 (dotnet/corefx#39848) Commit migrated from https://github.com/dotnet/corefx/commit/395db04daa4d76999036b3fb75ef2d431bcddfba --- src/libraries/CodeAnalysis.ruleset | 1 - .../tests/ExtendedFunctionalTests/UriTests.cs | 60 +++---- .../tests/FunctionalTests/UriBuilderRefreshTest.cs | 56 +++---- .../UriIsWellFormedUriStringTest.cs | 20 +-- .../tests/FunctionalTests/UriTests.cs | 184 ++++++++++----------- .../XmlSerializerTests.RuntimeOnly.cs | 98 +++++------ .../tests/XmlSerializer/XmlSerializerTests.cs | 66 ++++---- .../tests/DataContractJsonSerializer.cs | 88 +++++----- .../tests/DataContractSerializer.cs | 162 +++++++++--------- .../tests/DataContractSerializerStressTests.cs | 2 +- .../tests/XmlDictionaryReaderTests.cs | 4 +- .../tests/XmlDictionaryWriterTest.cs | 8 +- 12 files changed, 374 insertions(+), 375 deletions(-) diff --git a/src/libraries/CodeAnalysis.ruleset b/src/libraries/CodeAnalysis.ruleset index c5660d2..c1b0bf9 100644 --- a/src/libraries/CodeAnalysis.ruleset +++ b/src/libraries/CodeAnalysis.ruleset @@ -78,7 +78,6 @@ - diff --git a/src/libraries/System.Private.Uri/tests/ExtendedFunctionalTests/UriTests.cs b/src/libraries/System.Private.Uri/tests/ExtendedFunctionalTests/UriTests.cs index f486fa5..6908c6a 100644 --- a/src/libraries/System.Private.Uri/tests/ExtendedFunctionalTests/UriTests.cs +++ b/src/libraries/System.Private.Uri/tests/ExtendedFunctionalTests/UriTests.cs @@ -30,22 +30,22 @@ namespace System.PrivateUri.Tests Assert.Equal(@"http://foo/bar/baz#frag", s); s = uri.AbsolutePath; - Assert.Equal(@"/bar/baz", s); + Assert.Equal(@"/bar/baz", s); s = uri.AbsoluteUri; - Assert.Equal(@"http://foo/bar/baz#frag", s); + Assert.Equal(@"http://foo/bar/baz#frag", s); s = uri.Authority; - Assert.Equal(@"foo", s); + Assert.Equal(@"foo", s); s = uri.DnsSafeHost; - Assert.Equal(@"foo", s); + Assert.Equal(@"foo", s); s = uri.Fragment; - Assert.Equal(@"#frag", s); + Assert.Equal(@"#frag", s); s = uri.Host; - Assert.Equal(@"foo", s); + Assert.Equal(@"foo", s); uriHostNameType = uri.HostNameType; Assert.Equal(UriHostNameType.Dns, uriHostNameType); @@ -66,34 +66,34 @@ namespace System.PrivateUri.Tests Assert.False(b); s = uri.LocalPath; - Assert.Equal(@"/bar/baz", s); + Assert.Equal(@"/bar/baz", s); s = uri.OriginalString; - Assert.Equal(@"http://foo/bar/baz#frag", s); + Assert.Equal(@"http://foo/bar/baz#frag", s); s = uri.PathAndQuery; - Assert.Equal(@"/bar/baz", s); + Assert.Equal(@"/bar/baz", s); i = uri.Port; Assert.Equal(80, i); s = uri.Query; - Assert.Equal(@"", s); + Assert.Equal(@"", s); s = uri.Scheme; - Assert.Equal(@"http", s); + Assert.Equal(@"http", s); ss = uri.Segments; Assert.Equal(3, ss.Length); - Assert.Equal(@"/", ss[0]); - Assert.Equal(@"bar/", ss[1]); - Assert.Equal(@"baz", ss[2]); + Assert.Equal(@"/", ss[0]); + Assert.Equal(@"bar/", ss[1]); + Assert.Equal(@"baz", ss[2]); b = uri.UserEscaped; Assert.Equal(b, dontEscape); s = uri.UserInfo; - Assert.Equal(@"", s); + Assert.Equal(@"", s); } [InlineData(true)] @@ -118,22 +118,22 @@ namespace System.PrivateUri.Tests Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); s = uri.AbsolutePath; - Assert.Equal(@"/catalog/shownew.htm", s); + Assert.Equal(@"/catalog/shownew.htm", s); s = uri.AbsoluteUri; - Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); + Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); s = uri.Authority; - Assert.Equal(@"www.contoso.com", s); + Assert.Equal(@"www.contoso.com", s); s = uri.DnsSafeHost; - Assert.Equal(@"www.contoso.com", s); + Assert.Equal(@"www.contoso.com", s); s = uri.Fragment; - Assert.Equal(@"", s); + Assert.Equal(@"", s); s = uri.Host; - Assert.Equal(@"www.contoso.com", s); + Assert.Equal(@"www.contoso.com", s); uriHostNameType = uri.HostNameType; Assert.Equal(UriHostNameType.Dns, uriHostNameType); @@ -154,34 +154,34 @@ namespace System.PrivateUri.Tests Assert.False(b); s = uri.LocalPath; - Assert.Equal(@"/catalog/shownew.htm", s); + Assert.Equal(@"/catalog/shownew.htm", s); s = uri.OriginalString; - Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); + Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); s = uri.PathAndQuery; - Assert.Equal(@"/catalog/shownew.htm?date=today", s); + Assert.Equal(@"/catalog/shownew.htm?date=today", s); i = uri.Port; Assert.Equal(80, i); s = uri.Query; - Assert.Equal(@"?date=today", s); + Assert.Equal(@"?date=today", s); s = uri.Scheme; - Assert.Equal(@"http", s); + Assert.Equal(@"http", s); ss = uri.Segments; Assert.Equal(3, ss.Length); - Assert.Equal(@"/", ss[0]); - Assert.Equal(@"catalog/", ss[1]); - Assert.Equal(@"shownew.htm", ss[2]); + Assert.Equal(@"/", ss[0]); + Assert.Equal(@"catalog/", ss[1]); + Assert.Equal(@"shownew.htm", ss[2]); b = uri.UserEscaped; Assert.Equal(b, dontEscape); s = uri.UserInfo; - Assert.Equal(@"", s); + Assert.Equal(@"", s); } [Fact] diff --git a/src/libraries/System.Private.Uri/tests/FunctionalTests/UriBuilderRefreshTest.cs b/src/libraries/System.Private.Uri/tests/FunctionalTests/UriBuilderRefreshTest.cs index 99f4bd3..7562074 100644 --- a/src/libraries/System.Private.Uri/tests/FunctionalTests/UriBuilderRefreshTest.cs +++ b/src/libraries/System.Private.Uri/tests/FunctionalTests/UriBuilderRefreshTest.cs @@ -14,48 +14,48 @@ namespace System.PrivateUri.Tests public void UriBuilder_ChangeScheme_Refreshed() { UriBuilder builder = new UriBuilder(s_starterUri); - Assert.Equal(s_starterUri.Scheme, builder.Scheme); - Assert.Equal(s_starterUri.Scheme, builder.Uri.Scheme); + Assert.Equal(s_starterUri.Scheme, builder.Scheme); + Assert.Equal(s_starterUri.Scheme, builder.Uri.Scheme); string newValue = "newvalue"; builder.Scheme = newValue; - Assert.Equal(newValue, builder.Scheme); - Assert.Equal(newValue, builder.Uri.Scheme); + Assert.Equal(newValue, builder.Scheme); + Assert.Equal(newValue, builder.Uri.Scheme); } [Fact] public void UriBuilder_ChangeUser_Refreshed() { UriBuilder builder = new UriBuilder(s_starterUri); - Assert.Equal(s_starterUri.UserInfo, builder.UserName + ":" + builder.Password); - Assert.Equal(s_starterUri.UserInfo, builder.Uri.UserInfo); + Assert.Equal(s_starterUri.UserInfo, builder.UserName + ":" + builder.Password); + Assert.Equal(s_starterUri.UserInfo, builder.Uri.UserInfo); string newValue = "newvalue"; builder.UserName = newValue; - Assert.Equal(newValue, builder.UserName); - Assert.Equal(newValue + ":" + builder.Password, builder.Uri.UserInfo); + Assert.Equal(newValue, builder.UserName); + Assert.Equal(newValue + ":" + builder.Password, builder.Uri.UserInfo); } [Fact] public void UriBuilder_ChangePassword_Refreshed() { UriBuilder builder = new UriBuilder(s_starterUri); - Assert.Equal(s_starterUri.UserInfo, builder.UserName + ":" + builder.Password); - Assert.Equal(s_starterUri.UserInfo, builder.Uri.UserInfo); + Assert.Equal(s_starterUri.UserInfo, builder.UserName + ":" + builder.Password); + Assert.Equal(s_starterUri.UserInfo, builder.Uri.UserInfo); string newValue = "newvalue"; builder.Password = newValue; - Assert.Equal(newValue, builder.Password); - Assert.Equal(builder.UserName + ":" + newValue, builder.Uri.UserInfo); + Assert.Equal(newValue, builder.Password); + Assert.Equal(builder.UserName + ":" + newValue, builder.Uri.UserInfo); } [Fact] public void UriBuilder_ChangeHost_Refreshed() { UriBuilder builder = new UriBuilder(s_starterUri); - Assert.Equal(s_starterUri.Host, builder.Host); - Assert.Equal(s_starterUri.Host, builder.Uri.Host); + Assert.Equal(s_starterUri.Host, builder.Host); + Assert.Equal(s_starterUri.Host, builder.Uri.Host); string newValue = "newvalue"; builder.Host = newValue; - Assert.Equal(newValue, builder.Host); - Assert.Equal(newValue, builder.Uri.Host); + Assert.Equal(newValue, builder.Host); + Assert.Equal(newValue, builder.Uri.Host); } [Fact] @@ -74,36 +74,36 @@ namespace System.PrivateUri.Tests public void UriBuilder_ChangePath_Refreshed() { UriBuilder builder = new UriBuilder(s_starterUri); - Assert.Equal(s_starterUri.AbsolutePath, builder.Path); - Assert.Equal(s_starterUri.AbsolutePath, builder.Uri.AbsolutePath); + Assert.Equal(s_starterUri.AbsolutePath, builder.Path); + Assert.Equal(s_starterUri.AbsolutePath, builder.Uri.AbsolutePath); string newValue = "/newvalue"; builder.Path = newValue; - Assert.Equal(newValue, builder.Path); - Assert.Equal(newValue, builder.Uri.AbsolutePath); + Assert.Equal(newValue, builder.Path); + Assert.Equal(newValue, builder.Uri.AbsolutePath); } [Fact] public void UriBuilder_ChangeQuery_Refreshed() { UriBuilder builder = new UriBuilder(s_starterUri); - Assert.Equal(s_starterUri.Query, builder.Query); - Assert.Equal(s_starterUri.Query, builder.Uri.Query); + Assert.Equal(s_starterUri.Query, builder.Query); + Assert.Equal(s_starterUri.Query, builder.Uri.Query); string newValue = "newvalue"; builder.Query = newValue; - Assert.Equal("?" + newValue, builder.Query); - Assert.Equal("?" + newValue, builder.Uri.Query); + Assert.Equal("?" + newValue, builder.Query); + Assert.Equal("?" + newValue, builder.Uri.Query); } [Fact] public void UriBuilder_ChangeFragment_Refreshed() { UriBuilder builder = new UriBuilder(s_starterUri); - Assert.Equal(s_starterUri.Fragment, builder.Fragment); - Assert.Equal(s_starterUri.Fragment, builder.Uri.Fragment); + Assert.Equal(s_starterUri.Fragment, builder.Fragment); + Assert.Equal(s_starterUri.Fragment, builder.Uri.Fragment); string newValue = "newvalue"; builder.Fragment = newValue; - Assert.Equal("#" + newValue, builder.Fragment); - Assert.Equal("#" + newValue, builder.Uri.Fragment); + Assert.Equal("#" + newValue, builder.Fragment); + Assert.Equal("#" + newValue, builder.Uri.Fragment); } } } diff --git a/src/libraries/System.Private.Uri/tests/FunctionalTests/UriIsWellFormedUriStringTest.cs b/src/libraries/System.Private.Uri/tests/FunctionalTests/UriIsWellFormedUriStringTest.cs index 0179e2a..f5b1e6d 100644 --- a/src/libraries/System.Private.Uri/tests/FunctionalTests/UriIsWellFormedUriStringTest.cs +++ b/src/libraries/System.Private.Uri/tests/FunctionalTests/UriIsWellFormedUriStringTest.cs @@ -142,7 +142,7 @@ namespace System.PrivateUri.Tests Uri result = new Uri(baseUri, rel); - Assert.Equal(test.LocalPath, result.LocalPath); // "Transitivity failure" + Assert.Equal(test.LocalPath, result.LocalPath); // "Transitivity failure" Assert.True(string.CompareOrdinal(rel.ToString(), 0, "./", 0, 2) == 0, "Cannot have colon in first segment, must append ./"); } @@ -156,7 +156,7 @@ namespace System.PrivateUri.Tests Uri result = new Uri(baseUri, rel); - Assert.Equal(test.LocalPath, result.LocalPath); //"Transitivity failure" + Assert.Equal(test.LocalPath, result.LocalPath); //"Transitivity failure" } [Fact] @@ -168,12 +168,12 @@ namespace System.PrivateUri.Tests Assert.False(rel.IsAbsoluteUri, "Result should be relative"); - Assert.Equal("d:/hi:there/", rel.ToString()); + Assert.Equal("d:/hi:there/", rel.ToString()); Uri result = new Uri(baseUri, rel); - Assert.Equal(test.LocalPath, result.LocalPath); // "Transitivity failure" - Assert.Equal(test.ToString(), result.ToString()); // "Transitivity failure" + Assert.Equal(test.LocalPath, result.LocalPath); // "Transitivity failure" + Assert.Equal(test.ToString(), result.ToString()); // "Transitivity failure" } [Fact] @@ -187,7 +187,7 @@ namespace System.PrivateUri.Tests // This is a known oddity when mix and matching Unc & dos paths in this order. // The other way works as expected. - Assert.Equal("file:///u:/unc/hi:there/", result.ToString()); + Assert.Equal("file:///u:/unc/hi:there/", result.ToString()); } [Fact] @@ -199,7 +199,7 @@ namespace System.PrivateUri.Tests Uri result = new Uri(baseUri, rel); - Assert.Equal(test.LocalPath, result.LocalPath); // "Transitivity failure" + Assert.Equal(test.LocalPath, result.LocalPath); // "Transitivity failure" } [Fact] @@ -211,7 +211,7 @@ namespace System.PrivateUri.Tests Uri result = new Uri(baseUri, rel); - Assert.Equal(test.LocalPath, result.LocalPath); //"Transitivity failure" + Assert.Equal(test.LocalPath, result.LocalPath); //"Transitivity failure" } [Fact] @@ -223,7 +223,7 @@ namespace System.PrivateUri.Tests Uri result = new Uri(baseUri, rel); - Assert.Equal(test.LocalPath, result.LocalPath); //"Transitivity failure" + Assert.Equal(test.LocalPath, result.LocalPath); //"Transitivity failure" } [Fact] @@ -235,7 +235,7 @@ namespace System.PrivateUri.Tests Uri result = new Uri(baseUri, rel); - Assert.Equal(test.LocalPath, result.LocalPath); //"Transitivity failure" + Assert.Equal(test.LocalPath, result.LocalPath); //"Transitivity failure" } [Fact] diff --git a/src/libraries/System.Private.Uri/tests/FunctionalTests/UriTests.cs b/src/libraries/System.Private.Uri/tests/FunctionalTests/UriTests.cs index 68efc31..1b2ae68 100644 --- a/src/libraries/System.Private.Uri/tests/FunctionalTests/UriTests.cs +++ b/src/libraries/System.Private.Uri/tests/FunctionalTests/UriTests.cs @@ -56,22 +56,22 @@ namespace System.PrivateUri.Tests Assert.Equal(@"http://foo/bar/baz#frag", s); s = uri.AbsolutePath; - Assert.Equal(@"/bar/baz", s); + Assert.Equal(@"/bar/baz", s); s = uri.AbsoluteUri; - Assert.Equal(@"http://foo/bar/baz#frag", s); + Assert.Equal(@"http://foo/bar/baz#frag", s); s = uri.Authority; - Assert.Equal(@"foo", s); + Assert.Equal(@"foo", s); s = uri.DnsSafeHost; - Assert.Equal(@"foo", s); + Assert.Equal(@"foo", s); s = uri.Fragment; - Assert.Equal(@"#frag", s); + Assert.Equal(@"#frag", s); s = uri.Host; - Assert.Equal(@"foo", s); + Assert.Equal(@"foo", s); uriHostNameType = uri.HostNameType; Assert.Equal(UriHostNameType.Dns, uriHostNameType); @@ -92,34 +92,34 @@ namespace System.PrivateUri.Tests Assert.False(b); s = uri.LocalPath; - Assert.Equal(@"/bar/baz", s); + Assert.Equal(@"/bar/baz", s); s = uri.OriginalString; - Assert.Equal(@"http://foo/bar/baz#frag", s); + Assert.Equal(@"http://foo/bar/baz#frag", s); s = uri.PathAndQuery; - Assert.Equal(@"/bar/baz", s); + Assert.Equal(@"/bar/baz", s); i = uri.Port; Assert.Equal(80, i); s = uri.Query; - Assert.Equal(@"", s); + Assert.Equal(@"", s); s = uri.Scheme; - Assert.Equal(@"http", s); + Assert.Equal(@"http", s); ss = uri.Segments; Assert.Equal(3, ss.Length); - Assert.Equal(@"/", ss[0]); - Assert.Equal(@"bar/", ss[1]); - Assert.Equal(@"baz", ss[2]); + Assert.Equal(@"/", ss[0]); + Assert.Equal(@"bar/", ss[1]); + Assert.Equal(@"baz", ss[2]); b = uri.UserEscaped; Assert.False(b); s = uri.UserInfo; - Assert.Equal(@"", s); + Assert.Equal(@"", s); } [Fact] @@ -140,22 +140,22 @@ namespace System.PrivateUri.Tests Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); s = uri.AbsolutePath; - Assert.Equal(@"/catalog/shownew.htm", s); + Assert.Equal(@"/catalog/shownew.htm", s); s = uri.AbsoluteUri; - Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); + Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); s = uri.Authority; - Assert.Equal(@"www.contoso.com", s); + Assert.Equal(@"www.contoso.com", s); s = uri.DnsSafeHost; - Assert.Equal(@"www.contoso.com", s); + Assert.Equal(@"www.contoso.com", s); s = uri.Fragment; - Assert.Equal(@"", s); + Assert.Equal(@"", s); s = uri.Host; - Assert.Equal(@"www.contoso.com", s); + Assert.Equal(@"www.contoso.com", s); uriHostNameType = uri.HostNameType; Assert.Equal(UriHostNameType.Dns, uriHostNameType); @@ -176,34 +176,34 @@ namespace System.PrivateUri.Tests Assert.False(b); s = uri.LocalPath; - Assert.Equal(@"/catalog/shownew.htm", s); + Assert.Equal(@"/catalog/shownew.htm", s); s = uri.OriginalString; - Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); + Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); s = uri.PathAndQuery; - Assert.Equal(@"/catalog/shownew.htm?date=today", s); + Assert.Equal(@"/catalog/shownew.htm?date=today", s); i = uri.Port; Assert.Equal(80, i); s = uri.Query; - Assert.Equal(@"?date=today", s); + Assert.Equal(@"?date=today", s); s = uri.Scheme; - Assert.Equal(@"http", s); + Assert.Equal(@"http", s); ss = uri.Segments; Assert.Equal(3, ss.Length); - Assert.Equal(@"/", ss[0]); - Assert.Equal(@"catalog/", ss[1]); - Assert.Equal(@"shownew.htm", ss[2]); + Assert.Equal(@"/", ss[0]); + Assert.Equal(@"catalog/", ss[1]); + Assert.Equal(@"shownew.htm", ss[2]); b = uri.UserEscaped; Assert.False(b); s = uri.UserInfo; - Assert.Equal(@"", s); + Assert.Equal(@"", s); } [Fact] @@ -244,7 +244,7 @@ namespace System.PrivateUri.Tests Assert.Throws(() => { object o = uri.LocalPath; }); s = uri.OriginalString; - Assert.Equal(@"catalog/shownew.htm?date=today", s); + Assert.Equal(@"catalog/shownew.htm?date=today", s); Assert.Throws(() => { object o = uri.PathAndQuery; }); @@ -284,22 +284,22 @@ namespace System.PrivateUri.Tests Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); s = uri.AbsolutePath; - Assert.Equal(@"/catalog/shownew.htm", s); + Assert.Equal(@"/catalog/shownew.htm", s); s = uri.AbsoluteUri; - Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); + Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); s = uri.Authority; - Assert.Equal(@"www.contoso.com", s); + Assert.Equal(@"www.contoso.com", s); s = uri.DnsSafeHost; - Assert.Equal(@"www.contoso.com", s); + Assert.Equal(@"www.contoso.com", s); s = uri.Fragment; - Assert.Equal(@"", s); + Assert.Equal(@"", s); s = uri.Host; - Assert.Equal(@"www.contoso.com", s); + Assert.Equal(@"www.contoso.com", s); uriHostNameType = uri.HostNameType; Assert.Equal(UriHostNameType.Dns, uriHostNameType); @@ -320,34 +320,34 @@ namespace System.PrivateUri.Tests Assert.False(b); s = uri.LocalPath; - Assert.Equal(@"/catalog/shownew.htm", s); + Assert.Equal(@"/catalog/shownew.htm", s); s = uri.OriginalString; - Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); + Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); s = uri.PathAndQuery; - Assert.Equal(@"/catalog/shownew.htm?date=today", s); + Assert.Equal(@"/catalog/shownew.htm?date=today", s); i = uri.Port; Assert.Equal(80, i); s = uri.Query; - Assert.Equal(@"?date=today", s); + Assert.Equal(@"?date=today", s); s = uri.Scheme; - Assert.Equal(@"http", s); + Assert.Equal(@"http", s); ss = uri.Segments; Assert.Equal(3, ss.Length); - Assert.Equal(@"/", ss[0]); - Assert.Equal(@"catalog/", ss[1]); - Assert.Equal(@"shownew.htm", ss[2]); + Assert.Equal(@"/", ss[0]); + Assert.Equal(@"catalog/", ss[1]); + Assert.Equal(@"shownew.htm", ss[2]); b = uri.UserEscaped; Assert.False(b); s = uri.UserInfo; - Assert.Equal(@"", s); + Assert.Equal(@"", s); } [Fact] @@ -366,22 +366,22 @@ namespace System.PrivateUri.Tests Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); s = uri.AbsolutePath; - Assert.Equal(@"/catalog/shownew.htm", s); + Assert.Equal(@"/catalog/shownew.htm", s); s = uri.AbsoluteUri; - Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); + Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); s = uri.Authority; - Assert.Equal(@"www.contoso.com", s); + Assert.Equal(@"www.contoso.com", s); s = uri.DnsSafeHost; - Assert.Equal(@"www.contoso.com", s); + Assert.Equal(@"www.contoso.com", s); s = uri.Fragment; - Assert.Equal(@"", s); + Assert.Equal(@"", s); s = uri.Host; - Assert.Equal(@"www.contoso.com", s); + Assert.Equal(@"www.contoso.com", s); uriHostNameType = uri.HostNameType; Assert.Equal(UriHostNameType.Dns, uriHostNameType); @@ -402,34 +402,34 @@ namespace System.PrivateUri.Tests Assert.False(b); s = uri.LocalPath; - Assert.Equal(@"/catalog/shownew.htm", s); + Assert.Equal(@"/catalog/shownew.htm", s); s = uri.OriginalString; - Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); + Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); s = uri.PathAndQuery; - Assert.Equal(@"/catalog/shownew.htm?date=today", s); + Assert.Equal(@"/catalog/shownew.htm?date=today", s); i = uri.Port; Assert.Equal(80, i); s = uri.Query; - Assert.Equal(@"?date=today", s); + Assert.Equal(@"?date=today", s); s = uri.Scheme; - Assert.Equal(@"http", s); + Assert.Equal(@"http", s); ss = uri.Segments; Assert.Equal(3, ss.Length); - Assert.Equal(@"/", ss[0]); - Assert.Equal(@"catalog/", ss[1]); - Assert.Equal(@"shownew.htm", ss[2]); + Assert.Equal(@"/", ss[0]); + Assert.Equal(@"catalog/", ss[1]); + Assert.Equal(@"shownew.htm", ss[2]); b = uri.UserEscaped; Assert.False(b); s = uri.UserInfo; - Assert.Equal(@"", s); + Assert.Equal(@"", s); } [Fact] @@ -449,22 +449,22 @@ namespace System.PrivateUri.Tests Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); s = uri.AbsolutePath; - Assert.Equal(@"/catalog/shownew.htm", s); + Assert.Equal(@"/catalog/shownew.htm", s); s = uri.AbsoluteUri; - Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); + Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); s = uri.Authority; - Assert.Equal(@"www.contoso.com", s); + Assert.Equal(@"www.contoso.com", s); s = uri.DnsSafeHost; - Assert.Equal(@"www.contoso.com", s); + Assert.Equal(@"www.contoso.com", s); s = uri.Fragment; - Assert.Equal(@"", s); + Assert.Equal(@"", s); s = uri.Host; - Assert.Equal(@"www.contoso.com", s); + Assert.Equal(@"www.contoso.com", s); uriHostNameType = uri.HostNameType; Assert.Equal(UriHostNameType.Dns, uriHostNameType); @@ -485,34 +485,34 @@ namespace System.PrivateUri.Tests Assert.False(b); s = uri.LocalPath; - Assert.Equal(@"/catalog/shownew.htm", s); + Assert.Equal(@"/catalog/shownew.htm", s); s = uri.OriginalString; - Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); + Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); s = uri.PathAndQuery; - Assert.Equal(@"/catalog/shownew.htm?date=today", s); + Assert.Equal(@"/catalog/shownew.htm?date=today", s); i = uri.Port; Assert.Equal(80, i); s = uri.Query; - Assert.Equal(@"?date=today", s); + Assert.Equal(@"?date=today", s); s = uri.Scheme; - Assert.Equal(@"http", s); + Assert.Equal(@"http", s); ss = uri.Segments; Assert.Equal(3, ss.Length); - Assert.Equal(@"/", ss[0]); - Assert.Equal(@"catalog/", ss[1]); - Assert.Equal(@"shownew.htm", ss[2]); + Assert.Equal(@"/", ss[0]); + Assert.Equal(@"catalog/", ss[1]); + Assert.Equal(@"shownew.htm", ss[2]); b = uri.UserEscaped; Assert.False(b); s = uri.UserInfo; - Assert.Equal(@"", s); + Assert.Equal(@"", s); } [Fact] @@ -533,22 +533,22 @@ namespace System.PrivateUri.Tests Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); s = uri.AbsolutePath; - Assert.Equal(@"/catalog/shownew.htm", s); + Assert.Equal(@"/catalog/shownew.htm", s); s = uri.AbsoluteUri; - Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); + Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); s = uri.Authority; - Assert.Equal(@"www.contoso.com", s); + Assert.Equal(@"www.contoso.com", s); s = uri.DnsSafeHost; - Assert.Equal(@"www.contoso.com", s); + Assert.Equal(@"www.contoso.com", s); s = uri.Fragment; - Assert.Equal(@"", s); + Assert.Equal(@"", s); s = uri.Host; - Assert.Equal(@"www.contoso.com", s); + Assert.Equal(@"www.contoso.com", s); uriHostNameType = uri.HostNameType; Assert.Equal(UriHostNameType.Dns, uriHostNameType); @@ -569,34 +569,34 @@ namespace System.PrivateUri.Tests Assert.False(b); s = uri.LocalPath; - Assert.Equal(@"/catalog/shownew.htm", s); + Assert.Equal(@"/catalog/shownew.htm", s); s = uri.OriginalString; - Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); + Assert.Equal(@"http://www.contoso.com/catalog/shownew.htm?date=today", s); s = uri.PathAndQuery; - Assert.Equal(@"/catalog/shownew.htm?date=today", s); + Assert.Equal(@"/catalog/shownew.htm?date=today", s); i = uri.Port; Assert.Equal(80, i); s = uri.Query; - Assert.Equal(@"?date=today", s); + Assert.Equal(@"?date=today", s); s = uri.Scheme; - Assert.Equal(@"http", s); + Assert.Equal(@"http", s); ss = uri.Segments; Assert.Equal(3, ss.Length); - Assert.Equal(@"/", ss[0]); - Assert.Equal(@"catalog/", ss[1]); - Assert.Equal(@"shownew.htm", ss[2]); + Assert.Equal(@"/", ss[0]); + Assert.Equal(@"catalog/", ss[1]); + Assert.Equal(@"shownew.htm", ss[2]); b = uri.UserEscaped; Assert.False(b); s = uri.UserInfo; - Assert.Equal(@"", s); + Assert.Equal(@"", s); } [Fact] @@ -645,7 +645,7 @@ namespace System.PrivateUri.Tests Assert.Throws(() => { object o = uri.LocalPath; }); s = uri.OriginalString; - Assert.Equal(@"index.htm?date=today", s); + Assert.Equal(@"index.htm?date=today", s); Assert.Throws(() => { object o = uri.PathAndQuery; }); diff --git a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.RuntimeOnly.cs b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.RuntimeOnly.cs index 064864f..8ae623a 100644 --- a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.RuntimeOnly.cs +++ b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.RuntimeOnly.cs @@ -242,22 +242,22 @@ public static partial class XmlSerializerTests [Fact] public static void Xml_StringAsRoot() { - Assert.StrictEqual("abc", SerializeAndDeserialize("abc", + Assert.Equal("abc", SerializeAndDeserialize("abc", @" abc")); - Assert.StrictEqual(" a b ", SerializeAndDeserialize(" a b ", + Assert.Equal(" a b ", SerializeAndDeserialize(" a b ", @" a b ")); Assert.Null(SerializeAndDeserialize(null, @" ")); - Assert.StrictEqual("", SerializeAndDeserialize("", + Assert.Equal("", SerializeAndDeserialize("", @" ")); - Assert.StrictEqual(SerializeAndDeserialize(" ", + Assert.Equal(SerializeAndDeserialize(" ", @" "), string.Empty); - Assert.StrictEqual("Hello World! \u6F22 \u00F1", SerializeAndDeserialize("Hello World! \u6F22 \u00F1", + Assert.Equal("Hello World! \u6F22 \u00F1", SerializeAndDeserialize("Hello World! \u6F22 \u00F1", @" Hello World! 漢 ñ")); } @@ -371,7 +371,7 @@ public static partial class XmlSerializerTests Assert.True(y.Count == 2); string itemsInY = string.Join("", y); - Assert.StrictEqual("a1a2", itemsInY); + Assert.Equal("a1a2", itemsInY); } [Fact] @@ -455,12 +455,12 @@ public static partial class XmlSerializerTests private static void VerifyXElementObject(XElement x1, XElement x2, bool checkFirstAttribute = true) { - Assert.StrictEqual(x1.Value, x2.Value); + Assert.Equal(x1.Value, x2.Value); Assert.StrictEqual(x1.Name, x2.Name); if (checkFirstAttribute) { Assert.StrictEqual(x1.FirstAttribute.Name, x2.FirstAttribute.Name); - Assert.StrictEqual(x1.FirstAttribute.Value, x2.FirstAttribute.Value); + Assert.Equal(x1.FirstAttribute.Value, x2.FirstAttribute.Value); } } @@ -642,7 +642,7 @@ public static partial class XmlSerializerTests [Fact] public static void Xml_DefaultNamespaceChangeTest() { - Assert.StrictEqual( + Assert.Equal( "Teststring", SerializeAndDeserialize("Teststring", @" @@ -661,7 +661,7 @@ public static partial class XmlSerializerTests 11 ", () => { return new XmlSerializer(typeof(SimpleType), "MycustomDefaultNamespace"); }); - Assert.StrictEqual(value.P1, o.P1); + Assert.Equal(value.P1, o.P1); Assert.StrictEqual(value.P2, o.P2); } @@ -678,7 +678,7 @@ public static partial class XmlSerializerTests 11 ", () => { return new XmlSerializer(typeof(SimpleType), "MycustomDefaultNamespace"); }, xns: xns); - Assert.StrictEqual(value.P1, o.P1); + Assert.Equal(value.P1, o.P1); Assert.StrictEqual(value.P2, o.P2); } @@ -747,8 +747,8 @@ public static partial class XmlSerializerTests
foo
bar "); - Assert.StrictEqual(original.header, actual.header); - Assert.StrictEqual(original.body, actual.body); + Assert.Equal(original.header, actual.header); + Assert.Equal(original.body, actual.body); } [Fact] @@ -764,8 +764,8 @@ public static partial class XmlSerializerTests bar "); - Assert.StrictEqual(original.header, actual.header); - Assert.StrictEqual(original.body, actual.body); + Assert.Equal(original.header, actual.header); + Assert.Equal(original.body, actual.body); Assert.NotNull(actual.xmlns); Assert.Contains(ns, actual.xmlns.ToArray()); } @@ -790,7 +790,7 @@ public static partial class XmlSerializerTests var actual = SerializeAndDeserialize(expected, @"Element innertext"); Assert.NotNull(actual); - Assert.StrictEqual(expected.InnerText, actual.InnerText); + Assert.Equal(expected.InnerText, actual.InnerText); } [Fact] @@ -801,7 +801,7 @@ public static partial class XmlSerializerTests var actual = SerializeAndDeserialize(expected, @"Head content

Heading1

Text in body
"); Assert.NotNull(actual); - Assert.StrictEqual(expected.OuterXml, actual.OuterXml); + Assert.Equal(expected.OuterXml, actual.OuterXml); } [Fact] @@ -837,15 +837,15 @@ public static partial class XmlSerializerTests "); Assert.StrictEqual(value.PropertyWithXmlElementAttribute.Count, actual.PropertyWithXmlElementAttribute.Count); - Assert.StrictEqual(value.PropertyWithXmlElementAttribute[0], actual.PropertyWithXmlElementAttribute[0]); - Assert.StrictEqual(value.PropertyWithXmlElementAttribute[1], actual.PropertyWithXmlElementAttribute[1]); + Assert.Equal(value.PropertyWithXmlElementAttribute[0], actual.PropertyWithXmlElementAttribute[0]); + Assert.Equal(value.PropertyWithXmlElementAttribute[1], actual.PropertyWithXmlElementAttribute[1]); Assert.StrictEqual(value.IntList.Count, actual.IntList.Count); Assert.StrictEqual(value.IntList[0], actual.IntList[0]); Assert.StrictEqual(value.StringList.Count, actual.StringList.Count); - Assert.StrictEqual(value.StringList[0], actual.StringList[0]); - Assert.StrictEqual(value.StringList[1], actual.StringList[1]); + Assert.Equal(value.StringList[0], actual.StringList[0]); + Assert.Equal(value.StringList[1], actual.StringList[1]); Assert.StrictEqual(value.AnotherStringList.Count, actual.AnotherStringList.Count); - Assert.StrictEqual(value.AnotherStringList[0], actual.AnotherStringList[0]); + Assert.Equal(value.AnotherStringList[0], actual.AnotherStringList[0]); Assert.StrictEqual(value.PublicIntListField[0], actual.PublicIntListField[0]); Assert.StrictEqual(value.PublicIntListFieldWithXmlElementAttribute[0], actual.PublicIntListFieldWithXmlElementAttribute[0]); } @@ -866,7 +866,7 @@ public static partial class XmlSerializerTests "); Assert.StrictEqual(1, actual.Count); Assert.StrictEqual(value[0].Id, actual[0].Id); - Assert.StrictEqual(value[0].Name, actual[0].Name); + Assert.Equal(value[0].Name, actual[0].Name); } [Fact] @@ -886,8 +886,8 @@ public static partial class XmlSerializerTests "); Assert.StrictEqual(2, actual.Count); - Assert.StrictEqual(value[0].Name, actual[0].Name); - Assert.StrictEqual(value[1].Name, actual[1].Name); + Assert.Equal(value[0].Name, actual[0].Name); + Assert.Equal(value[1].Name, actual[1].Name); } [Fact] @@ -907,8 +907,8 @@ public static partial class XmlSerializerTests "); Assert.StrictEqual(2, actual.Count); - Assert.StrictEqual(value[0].Name, actual[0].Name); - Assert.StrictEqual(value[1].Name, actual[1].Name); + Assert.Equal(value[0].Name, actual[0].Name); + Assert.Equal(value[1].Name, actual[1].Name); } [Fact] @@ -945,12 +945,12 @@ public static partial class XmlSerializerTests stream.Seek(0, SeekOrigin.Begin); List actual = (List)serializer.Deserialize(stream); Assert.StrictEqual(2, actual.Count); - Assert.StrictEqual("SecondAdventureImage", actual[0].ImageName); + Assert.Equal("SecondAdventureImage", actual[0].ImageName); Assert.StrictEqual(SlideEventType.LaunchSection, actual[0].EventType); - Assert.StrictEqual("Adventures.Episode2.Details", actual[0].EventData); - Assert.StrictEqual(actual[0].ImageName, actual[1].ImageName); + Assert.Equal("Adventures.Episode2.Details", actual[0].EventData); + Assert.Equal(actual[0].ImageName, actual[1].ImageName); Assert.StrictEqual(actual[0].EventType, actual[1].EventType); - Assert.StrictEqual(actual[0].EventData, actual[1].EventData); + Assert.Equal(actual[0].EventData, actual[1].EventData); } [Fact] @@ -1008,7 +1008,7 @@ public static partial class XmlSerializerTests var actual = SerializeAndDeserialize(expected, @"TrumpettrueCornettrue", () => serializer); - Assert.StrictEqual(expected.Instruments[0].Name, actual.Instruments[0].Name); + Assert.Equal(expected.Instruments[0].Name, actual.Instruments[0].Name); // XmlSerializer(Type, XmlAttributeOverrides, Type[], XmlRootAttribute, String) var root = new XmlRootAttribute("Collection"); @@ -1016,7 +1016,7 @@ public static partial class XmlSerializerTests actual = SerializeAndDeserialize(expected, @"TrumpettrueCornettrue", () => serializer); - Assert.StrictEqual(expected.Instruments[0].Name, actual.Instruments[0].Name); + Assert.Equal(expected.Instruments[0].Name, actual.Instruments[0].Name); Assert.Throws(() => { @@ -2768,8 +2768,8 @@ public static partial class XmlSerializerTests Assert.StrictEqual(value.XmlElementProperty, actual.XmlElementProperty); Assert.Equal(value.XmlEnumProperty, actual.XmlEnumProperty); Assert.StrictEqual(value.XmlIncludeProperty, actual.XmlIncludeProperty); - Assert.StrictEqual(value.XmlNamespaceDeclarationsProperty, actual.XmlNamespaceDeclarationsProperty); - Assert.StrictEqual(value.XmlTextProperty, actual.XmlTextProperty); + Assert.Equal(value.XmlNamespaceDeclarationsProperty, actual.XmlNamespaceDeclarationsProperty); + Assert.Equal(value.XmlTextProperty, actual.XmlTextProperty); } [Fact] @@ -2781,7 +2781,7 @@ public static partial class XmlSerializerTests Foo "); - Assert.StrictEqual(value.Name, actual.Name); + Assert.Equal(value.Name, actual.Name); } [Fact] @@ -2794,7 +2794,7 @@ public static partial class XmlSerializerTests var deserializedValue = SerializeAndDeserialize(value, "\r\n\r\n \r\n 3\r\n 6\r\n 5\r\n 4\r\n \r\n 1\r\n Current\r\n Microsoft\r\n true\r\n \r\n \r\n Ean\r\n 2013-01-02T00:00:00\r\n 1\r\n 1\r\n offset\r\n \r\n \r\n \r\n one\r\n two\r\n \r\n false\r\n", null, true); Assert.StrictEqual(deserializedValue.ArticleViewCount, value.ArticleViewCount); - Assert.StrictEqual(deserializedValue.CurrentlyReadingProductEAN, value.CurrentlyReadingProductEAN); + Assert.Equal(deserializedValue.CurrentlyReadingProductEAN, value.CurrentlyReadingProductEAN); Assert.StrictEqual(deserializedValue.CurrentPaymentType, value.CurrentPaymentType); Assert.StrictEqual(deserializedValue.IsFirstRun, value.IsFirstRun); } @@ -2804,11 +2804,11 @@ public static partial class XmlSerializerTests { DerivedTypeWithDifferentOverrides value = new DerivedTypeWithDifferentOverrides() { Name1 = "Name1", Name2 = "Name2", Name3 = "Name3", Name4 = "Name4", Name5 = "Name5" }; DerivedTypeWithDifferentOverrides actual = SerializeAndDeserialize(value, @"Name1Name2Name3Name5"); - Assert.StrictEqual(value.Name1, actual.Name1); - Assert.StrictEqual(value.Name2, actual.Name2); - Assert.StrictEqual(value.Name3, actual.Name3); + Assert.Equal(value.Name1, actual.Name1); + Assert.Equal(value.Name2, actual.Name2); + Assert.Equal(value.Name3, actual.Name3); Assert.Null(actual.Name4); - Assert.StrictEqual(value.Name5, actual.Name5); + Assert.Equal(value.Name5, actual.Name5); } [Fact] @@ -2821,18 +2821,18 @@ public static partial class XmlSerializerTests ((DerivedTypeWithDifferentOverrides)value).Name6 = "MidLevelName6"; ((SerializationTypes.BaseType)value).Name6 = "BaseLevelName6"; DerivedTypeWithDifferentOverrides2 actual = SerializeAndDeserialize(value, @"Name1Name2Name3BaseLevelName4MidLevelName5BaseLevelName6"); - Assert.StrictEqual(value.Name1, actual.Name1); - Assert.StrictEqual(value.Name2, actual.Name2); - Assert.StrictEqual(value.Name3, actual.Name3); + Assert.Equal(value.Name1, actual.Name1); + Assert.Equal(value.Name2, actual.Name2); + Assert.Equal(value.Name3, actual.Name3); Assert.Null(actual.Name4); Assert.Null(((DerivedTypeWithDifferentOverrides)actual).Name4); - Assert.StrictEqual(((SerializationTypes.BaseType)value).Name4, ((SerializationTypes.BaseType)actual).Name4); + Assert.Equal(((SerializationTypes.BaseType)value).Name4, ((SerializationTypes.BaseType)actual).Name4); Assert.Null(actual.Name5); - Assert.StrictEqual(((DerivedTypeWithDifferentOverrides)value).Name5, ((DerivedTypeWithDifferentOverrides)actual).Name5); + Assert.Equal(((DerivedTypeWithDifferentOverrides)value).Name5, ((DerivedTypeWithDifferentOverrides)actual).Name5); Assert.Null(((SerializationTypes.BaseType)actual).Name5); Assert.Null(actual.Name6); - Assert.StrictEqual(((DerivedTypeWithDifferentOverrides)actual).Name6, ((SerializationTypes.BaseType)actual).Name6); - Assert.StrictEqual(((SerializationTypes.BaseType)actual).Name6, ((SerializationTypes.BaseType)actual).Name6); + Assert.Equal(((DerivedTypeWithDifferentOverrides)actual).Name6, ((SerializationTypes.BaseType)actual).Name6); + Assert.Equal(((SerializationTypes.BaseType)actual).Name6, ((SerializationTypes.BaseType)actual).Name6); } [Fact] @@ -2863,7 +2863,7 @@ public static partial class XmlSerializerTests var value = new UnspecifiedRootSerializationType(); var actual = SerializeAndDeserialize(value, "\r\n\r\n 0\r\n", () => { return new XmlSerializer(Type.GetType(typeof(UnspecifiedRootSerializationType).FullName)); }); Assert.StrictEqual(value.MyIntProperty, actual.MyIntProperty); - Assert.StrictEqual(value.MyStringProperty, actual.MyStringProperty); + Assert.Equal(value.MyStringProperty, actual.MyStringProperty); } [Fact] diff --git a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs index d60b438..9d89429 100644 --- a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs +++ b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs @@ -151,8 +151,8 @@ string.Format(@" Assert.NotNull(y); Assert.True(y.Count == 2); - Assert.StrictEqual((string)x[0], (string)y[0]); - Assert.StrictEqual((string)x[1], (string)y[1]); + Assert.Equal((string)x[0], (string)y[0]); + Assert.Equal((string)x[1], (string)y[1]); } [Fact] @@ -214,7 +214,7 @@ string.Format(@" "); Assert.StrictEqual(value.MyEnum1, actual.MyEnum1); - Assert.StrictEqual(value.MyStruct.Data, actual.MyStruct.Data); + Assert.Equal(value.MyStruct.Data, actual.MyStruct.Data); } [Fact] @@ -276,7 +276,7 @@ string.Format(@" () => { return new XmlSerializer(typeof(KnownTypesThroughConstructor), new Type[] { typeof(MyEnum), typeof(SimpleKnownTypeValue) }); }); Assert.StrictEqual((MyEnum)value.EnumValue, (MyEnum)actual.EnumValue); - Assert.StrictEqual(((SimpleKnownTypeValue)value.SimpleTypeValue).StrProperty, ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); + Assert.Equal(((SimpleKnownTypeValue)value.SimpleTypeValue).StrProperty, ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); } [Fact] @@ -300,7 +300,7 @@ string.Format(@" Assert.StrictEqual(value.DateTimeProperty, actual.DateTimeProperty); Assert.StrictEqual(value.IntProperty, actual.IntProperty); - Assert.StrictEqual(value.StringProperty, actual.StringProperty); + Assert.Equal(value.StringProperty, actual.StringProperty); Assert.Equal(value.ListProperty.ToArray(), actual.ListProperty.ToArray()); } @@ -327,9 +327,9 @@ string.Format(@" true "); - Assert.StrictEqual(value.ClassID, actual.ClassID); - Assert.StrictEqual(value.DisplayName, actual.DisplayName); - Assert.StrictEqual(value.Id, actual.Id); + Assert.Equal(value.ClassID, actual.ClassID); + Assert.Equal(value.DisplayName, actual.DisplayName); + Assert.Equal(value.Id, actual.Id); Assert.StrictEqual(value.IsLoaded, actual.IsLoaded); } @@ -360,8 +360,8 @@ string.Format(@" Assert.StrictEqual(actual.XmlElementProperty, value.XmlElementProperty); Assert.Equal(actual.XmlEnumProperty, value.XmlEnumProperty); Assert.StrictEqual(actual.XmlIncludeProperty, value.XmlIncludeProperty); - Assert.StrictEqual(actual.XmlNamespaceDeclarationsProperty, value.XmlNamespaceDeclarationsProperty); - Assert.StrictEqual(actual.XmlTextProperty, value.XmlTextProperty); + Assert.Equal(actual.XmlNamespaceDeclarationsProperty, value.XmlNamespaceDeclarationsProperty); + Assert.Equal(actual.XmlTextProperty, value.XmlTextProperty); } [Fact] @@ -382,10 +382,10 @@ string.Format(@" var obj = (TypeWithAnyAttribute)serializer.Deserialize(stream); Assert.NotNull(obj); Assert.StrictEqual(intProperty, obj.IntProperty); - Assert.StrictEqual(name, obj.Name); + Assert.Equal(name, obj.Name); Assert.StrictEqual(2, obj.Attributes.Length); - Assert.StrictEqual(attribute1, obj.Attributes[0].Value); - Assert.StrictEqual(attribute2, obj.Attributes[1].Value); + Assert.Equal(attribute1, obj.Attributes[0].Value); + Assert.Equal(attribute2, obj.Attributes[1].Value); } } @@ -454,7 +454,7 @@ string.Format(@" var actual = SerializeAndDeserialize(value, @" "); - Assert.StrictEqual(value.StringValue, actual.StringValue); + Assert.Equal(value.StringValue, actual.StringValue); Assert.StrictEqual(value.GetPrivateMember(), actual.GetPrivateMember()); Assert.True(ClassImplementingIXmlSerialiable.ReadXmlInvoked); Assert.True(ClassImplementingIXmlSerialiable.WriteXmlInvoked); @@ -466,7 +466,7 @@ string.Format(@" var value = new TypeWithPropertyNameSpecified() { MyField = "MyField", MyFieldIgnored = 99, MyFieldSpecified = true, MyFieldIgnoredSpecified = false }; var actual = SerializeAndDeserialize(value, @"MyField"); - Assert.StrictEqual(value.MyField, actual.MyField); + Assert.Equal(value.MyField, actual.MyField); Assert.StrictEqual(0, actual.MyFieldIgnored); } @@ -478,7 +478,7 @@ string.Format(@" @"1abctrue"); Assert.StrictEqual(value.NoneSchemaFormListProperty.Count, actual.NoneSchemaFormListProperty.Count); - Assert.StrictEqual(value.NoneSchemaFormListProperty[0], actual.NoneSchemaFormListProperty[0]); + Assert.Equal(value.NoneSchemaFormListProperty[0], actual.NoneSchemaFormListProperty[0]); Assert.StrictEqual(value.UnqualifiedSchemaFormListProperty.Count, actual.UnqualifiedSchemaFormListProperty.Count); Assert.StrictEqual(value.UnqualifiedSchemaFormListProperty[0], actual.UnqualifiedSchemaFormListProperty[0]); Assert.StrictEqual(value.QualifiedSchemaFormListProperty.Count, actual.QualifiedSchemaFormListProperty.Count); @@ -504,7 +504,7 @@ string.Format(@" val1val2"); Assert.NotNull(actual.Text); Assert.StrictEqual(1, actual.Text.Length); - Assert.StrictEqual("val1val2", actual.Text[0]); + Assert.Equal("val1val2", actual.Text[0]); } [Fact] @@ -513,7 +513,7 @@ string.Format(@" var value = new TypeWithSchemaFormInXmlAttribute() { TestProperty = "hello" }; var actual = SerializeAndDeserialize(value, @""); - Assert.StrictEqual(value.TestProperty, actual.TestProperty); + Assert.Equal(value.TestProperty, actual.TestProperty); } @@ -532,7 +532,7 @@ string.Format(@" Assert.StrictEqual(expected.Elements.Length, actual.Elements.Length); for (int i = 0; i < expected.Elements.Length; ++i) { - Assert.StrictEqual(expected.Elements[i].InnerText, actual.Elements[i].InnerText); + Assert.Equal(expected.Elements[i].InnerText, actual.Elements[i].InnerText); } } @@ -546,7 +546,7 @@ string.Format(@" @"Head content

Heading1

Text in body
"); Assert.NotNull(actual); Assert.NotNull(actual.Document); - Assert.StrictEqual(expected.Document.OuterXml, actual.Document.OuterXml); + Assert.Equal(expected.Document.OuterXml, actual.Document.OuterXml); } [Fact] @@ -555,13 +555,13 @@ string.Format(@" System.Reflection.TypeInfo ti = System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(TypeWithNonPublicDefaultConstructor)); TypeWithNonPublicDefaultConstructor value = null; value = (TypeWithNonPublicDefaultConstructor)FindDefaultConstructor(ti).Invoke(null); - Assert.StrictEqual("Mr. FooName", value.Name); + Assert.Equal("Mr. FooName", value.Name); var actual = SerializeAndDeserialize(value, @" Mr. FooName "); - Assert.StrictEqual(value.Name, actual.Name); + Assert.Equal(value.Name, actual.Name); } private static System.Reflection.ConstructorInfo FindDefaultConstructor(System.Reflection.TypeInfo ti) @@ -590,8 +590,8 @@ string.Format(@" XmlSerializer serializer = new XmlSerializer(typeof(ServerSettings)); StringReader reader = new StringReader(xml); var value = (ServerSettings)serializer.Deserialize(reader); - Assert.StrictEqual(@" http://s3.amazonaws.com/windows-prod-twc/desktop8/beacons.xml ", value.MetricConfigUrl); - Assert.StrictEqual(@" http://wxdata.weather.com/wxdata/", value.DS2Root); + Assert.Equal(@" http://s3.amazonaws.com/windows-prod-twc/desktop8/beacons.xml ", value.MetricConfigUrl); + Assert.Equal(@" http://wxdata.weather.com/wxdata/", value.DS2Root); } @@ -652,7 +652,7 @@ string.Format(@" // XmlSerializer.Deserialize(XmlReader) var actual = (SimpleType)serializer.Deserialize(reader); - Assert.StrictEqual(expected.P1, actual.P1); + Assert.Equal(expected.P1, actual.P1); Assert.StrictEqual(expected.P2, actual.P2); stream.Dispose(); @@ -829,7 +829,7 @@ string.Format(@" 1 "); Assert.NotNull(deserializedObj); - Assert.StrictEqual(obj.P1, deserializedObj.P1); + Assert.Equal(obj.P1, deserializedObj.P1); Assert.StrictEqual(obj.P2, deserializedObj.P2); } @@ -854,7 +854,7 @@ string.Format(@" Assert.StrictEqual(value.DateTimeProperty, actual.DateTimeProperty); Assert.StrictEqual(value.IntProperty, actual.IntProperty); - Assert.StrictEqual(value.StringProperty, actual.StringProperty); + Assert.Equal(value.StringProperty, actual.StringProperty); Assert.Equal(value.ListProperty.ToArray(), actual.ListProperty.ToArray()); } @@ -872,8 +872,8 @@ string.Format(@" var actual = SerializeAndDeserialize(value, "\r\n\r\n 109\r\n"); Assert.NotNull(actual); - Assert.StrictEqual(value.StringProperty, actual.StringProperty); - Assert.StrictEqual(value.EmptyStringProperty, actual.EmptyStringProperty); + Assert.Equal(value.StringProperty, actual.StringProperty); + Assert.Equal(value.EmptyStringProperty, actual.EmptyStringProperty); Assert.StrictEqual(value.IntProperty, actual.IntProperty); Assert.StrictEqual(value.CharProperty, actual.CharProperty); } @@ -892,7 +892,7 @@ string.Format(@" var actual = SerializeAndDeserialize(value, "\r\n\r\n NonEmpty\r\n NonDefaultValue\r\n 12\r\n 110\r\n"); Assert.NotNull(actual); - Assert.StrictEqual(value.StringProperty, actual.StringProperty); + Assert.Equal(value.StringProperty, actual.StringProperty); } [Fact] @@ -1003,7 +1003,7 @@ string.Format(@" var actual = SerializeAndDeserialize(value, "\r\n"); Assert.NotNull(actual); - Assert.StrictEqual(value.Foo, actual.Foo); + Assert.Equal(value.Foo, actual.Foo); } [Fact] @@ -1014,7 +1014,7 @@ string.Format(@" var actual = SerializeAndDeserialize(value, "\r\nSomeValue"); Assert.NotNull(actual); - Assert.StrictEqual(value.Foo, actual.Foo); + Assert.Equal(value.Foo, actual.Foo); } [Fact] @@ -1838,7 +1838,7 @@ string.Format(@" Lily&Lucy "); Assert.NotNull(y); - Assert.StrictEqual(x.Name, y.Name); + Assert.Equal(x.Name, y.Name); } private static readonly string s_defaultNs = "http://tempuri.org/"; diff --git a/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs b/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs index c3a2b66..4e4dc87 100644 --- a/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs +++ b/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs @@ -228,7 +228,7 @@ public static partial class DataContractJsonSerializerTests { foreach (string value in new string[] { "abc", " a b ", null, "", " ", "Hello World! 漢 ñ" }) { - Assert.StrictEqual(SerializeAndDeserialize(value, value == null ? "null" : string.Format(@"""{0}""", value.ToString())), value); + Assert.Equal(SerializeAndDeserialize(value, value == null ? "null" : string.Format(@"""{0}""", value.ToString())), value); } var testStrings = new[] @@ -272,7 +272,7 @@ public static partial class DataContractJsonSerializerTests foreach (var pair in testStrings) { - Assert.StrictEqual(SerializeAndDeserialize(pair.value, string.Format(@"""{0}""", pair.baseline)), pair.value); + Assert.Equal(SerializeAndDeserialize(pair.value, string.Format(@"""{0}""", pair.baseline)), pair.value); } } @@ -300,7 +300,7 @@ public static partial class DataContractJsonSerializerTests sw.Flush(); ms.Position = 0; string actual = (string)serializer.ReadObject(ms); - Assert.StrictEqual(pair.value, actual); + Assert.Equal(pair.value, actual); } } } @@ -794,7 +794,7 @@ public static partial class DataContractJsonSerializerTests Assert.True(y.Count == 2); string actual = string.Join("", y); - Assert.StrictEqual("a1a2", actual); + Assert.Equal("a1a2", actual); } [Fact] @@ -953,7 +953,7 @@ public static partial class DataContractJsonSerializerTests IDMA_1 x = new IDMA_1 { MyDataMember = "MyDataMember", MyIgnoreDataMember = "MyIgnoreDataMember", MyUnsetDataMember = "MyUnsetDataMember" }; IDMA_1 y = SerializeAndDeserialize(x, @"{""MyDataMember"":""MyDataMember""}"); Assert.NotNull(y); - Assert.StrictEqual(x.MyDataMember, y.MyDataMember); + Assert.Equal(x.MyDataMember, y.MyDataMember); Assert.Null(y.MyIgnoreDataMember); Assert.Null(y.MyUnsetDataMember); } @@ -1004,7 +1004,7 @@ public static partial class DataContractJsonSerializerTests Assert.NotNull(y); Assert.StrictEqual(1, y.Count); Assert.True(y["Key0"] is object[]); - Assert.StrictEqual("Key1-0", ((KeyValuePair)((object[])y["Key0"])[0]).Key); + Assert.Equal("Key1-0", ((KeyValuePair)((object[])y["Key0"])[0]).Key); Assert.StrictEqual("Value1-0", ((KeyValuePair)((object[])y["Key0"])[0]).Value); Assert.True(((KeyValuePair)((object[])y["Key0"])[1]).Value is object[]); Assert.StrictEqual("Value2-0", ((KeyValuePair)((object[])((KeyValuePair)((object[])y["Key0"])[1]).Value)[0]).Value); @@ -1016,7 +1016,7 @@ public static partial class DataContractJsonSerializerTests var x = new KeyValuePair("key1", "key1value"); var y = SerializeAndDeserialize>(x, @"{""key"":""key1"",""value"":""key1value""}"); - Assert.StrictEqual("key1", y.Key); + Assert.Equal("key1", y.Key); Assert.StrictEqual("key1value", y.Value); } @@ -1083,8 +1083,8 @@ public static partial class DataContractJsonSerializerTests var x = new TypeHasArrayOfASerializedAsB(true); var y = SerializeAndDeserialize(x, @"{""Items"":[{""Name"":""typeAValue""},{""Name"":""typeBValue""}]}"); - Assert.StrictEqual(x.Items[0].Name, y.Items[0].Name); - Assert.StrictEqual(x.Items[1].Name, y.Items[1].Name); + Assert.Equal(x.Items[0].Name, y.Items[0].Name); + Assert.Equal(x.Items[1].Name, y.Items[1].Name); } [Fact] @@ -1093,7 +1093,7 @@ public static partial class DataContractJsonSerializerTests var x = new WithDuplicateNames(true); var y = SerializeAndDeserialize(x, @"{""ClassA1"":{""Name"":""Hello World! 漢 ñ""},""ClassA2"":{""Nombre"":""""},""EnumA1"":1,""EnumA2"":1,""StructA1"":{""Text"":""""},""StructA2"":{""Texto"":""""}}"); - Assert.StrictEqual(x.ClassA1.Name, y.ClassA1.Name); + Assert.Equal(x.ClassA1.Name, y.ClassA1.Name); Assert.StrictEqual(x.StructA1, y.StructA1); Assert.StrictEqual(x.EnumA1, y.EnumA1); Assert.StrictEqual(x.EnumA2, y.EnumA2); @@ -1123,12 +1123,12 @@ public static partial class DataContractJsonSerializerTests private static void VerifyXElementObject(XElement x1, XElement x2, bool checkFirstAttribute = true) { - Assert.StrictEqual(x1.Value, x2.Value); + Assert.Equal(x1.Value, x2.Value); Assert.StrictEqual(x1.Name, x2.Name); if (checkFirstAttribute) { Assert.StrictEqual(x1.FirstAttribute.Name, x2.FirstAttribute.Name); - Assert.StrictEqual(x1.FirstAttribute.Value, x2.FirstAttribute.Value); + Assert.Equal(x1.FirstAttribute.Value, x2.FirstAttribute.Value); } } @@ -1172,7 +1172,7 @@ public static partial class DataContractJsonSerializerTests var x = new __TypeNameWithSpecialCharacters漢ñ() { PropertyNameWithSpecialCharacters漢ñ = "Test" }; var y = SerializeAndDeserialize<__TypeNameWithSpecialCharacters漢ñ>(x, @"{""PropertyNameWithSpecialCharacters漢ñ"":""Test""}"); - Assert.StrictEqual(x.PropertyNameWithSpecialCharacters漢ñ, y.PropertyNameWithSpecialCharacters漢ñ); + Assert.Equal(x.PropertyNameWithSpecialCharacters漢ñ, y.PropertyNameWithSpecialCharacters漢ñ); } [Fact] @@ -1203,7 +1203,7 @@ public static partial class DataContractJsonSerializerTests Assert.StrictEqual(1, actualObjectArray[2]); Assert.StrictEqual("string", actualObjectArray[3]); Assert.StrictEqual(Guid.Parse("2054fd3e-e118-476a-9962-1a882be51860"), Guid.Parse(actualObjectArray[4].ToString())); - Assert.StrictEqual(string.Format("/Date(1357084800000{0})/", timeZoneString), actualObjectArray[5].ToString()); + Assert.Equal(string.Format("/Date(1357084800000{0})/", timeZoneString), actualObjectArray[5].ToString()); int[][][] jaggedIntegerArray2 = new int[][][] { new int[][] { new int[] { 1 }, new int[] { 3 } }, new int[][] { new int[] { 0 } }, new int[][] { new int[] { } } }; var actualJaggedIntegerArray2 = SerializeAndDeserialize(jaggedIntegerArray2, "[[[1],[3]],[[0]],[[]]]"); @@ -1258,8 +1258,8 @@ public static partial class DataContractJsonSerializerTests var orininalElement = originalEnumerator.Current; var actualElement = actualEnumerator.Current; - Assert.StrictEqual(orininalElement.Data.Data, actualElement.Data.Data); - Assert.StrictEqual(orininalElement.RefData.Data, actualElement.RefData.Data); + Assert.Equal(orininalElement.Data.Data, actualElement.Data.Data); + Assert.Equal(orininalElement.RefData.Data, actualElement.RefData.Data); } } @@ -1336,7 +1336,7 @@ public static partial class DataContractJsonSerializerTests Assert.StrictEqual((MyEnum)value.EnumValue, (MyEnum)actual.EnumValue); Assert.True(actual.SimpleTypeValue is SimpleKnownTypeValue); - Assert.StrictEqual("PropertyValue", ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); + Assert.Equal("PropertyValue", ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); } #region private type has to be in with in the class @@ -1404,7 +1404,7 @@ public static partial class DataContractJsonSerializerTests { var value = new GenericTypeWithPrivateSetter("PropertyWithPrivateSetter's value"); var actual = SerializeAndDeserialize(value, @"{""PropertyWithPrivateSetter"":""PropertyWithPrivateSetter's value""}"); - Assert.StrictEqual(value.PropertyWithPrivateSetter, actual.PropertyWithPrivateSetter); + Assert.Equal(value.PropertyWithPrivateSetter, actual.PropertyWithPrivateSetter); } [Fact] @@ -1426,7 +1426,7 @@ public static partial class DataContractJsonSerializerTests stream.Position = 0; var obj2 = (TypeWithDateTimeStringProperty)dcjs.ReadObject(stream); - Assert.StrictEqual(obj.DateTimeString, obj2.DateTimeString); + Assert.Equal(obj.DateTimeString, obj2.DateTimeString); Assert.StrictEqual(obj.CurrentDateTime, obj2.CurrentDateTime); } @@ -1439,7 +1439,7 @@ public static partial class DataContractJsonSerializerTests sw.Flush(); ms.Seek(0, SeekOrigin.Begin); var result = (TypeWithDateTimeStringProperty)dcjs.ReadObject(ms); - Assert.StrictEqual(@"/Date(1411072352108-0700)/", result.DateTimeString); + Assert.Equal(@"/Date(1411072352108-0700)/", result.DateTimeString); } } @@ -1452,9 +1452,9 @@ public static partial class DataContractJsonSerializerTests var deserializedValue = SerializeAndDeserialize(value, @"{""Foo"":[{""Key"":10,""Value"":{""LevelNo"":1,""Name"":""Foo""}},{""Key"":20,""Value"":{""LevelNo"":2,""Name"":""Bar""}}]}"); Assert.StrictEqual(2, deserializedValue.Foo.Count); - Assert.StrictEqual("Foo", deserializedValue.Foo[10].Name); + Assert.Equal("Foo", deserializedValue.Foo[10].Name); Assert.StrictEqual(1, deserializedValue.Foo[10].LevelNo); - Assert.StrictEqual("Bar", deserializedValue.Foo[20].Name); + Assert.Equal("Bar", deserializedValue.Foo[20].Name); Assert.StrictEqual(2, deserializedValue.Foo[20].LevelNo); } @@ -1465,8 +1465,8 @@ public static partial class DataContractJsonSerializerTests value.HeadLine = new NewsArticle() { Title = "Foo News" }; var deserializedValue = SerializeAndDeserialize(value, @"{""HeadLine"":{""__type"":""NewsArticle:#SerializationTypes"",""Category"":""News"",""Title"":""Foo News""}}"); - Assert.StrictEqual("News", deserializedValue.HeadLine.Category); - Assert.StrictEqual("Foo News", deserializedValue.HeadLine.Title); + Assert.Equal("News", deserializedValue.HeadLine.Category); + Assert.Equal("Foo News", deserializedValue.HeadLine.Title); } [Fact] @@ -1477,8 +1477,8 @@ public static partial class DataContractJsonSerializerTests var deserializedValue = SerializeAndDeserialize(value, @"{""Articles"":[{""__type"":""SummaryArticle:#SerializationTypes"",""Category"":""Summary"",""Title"":""Bar Summary""}]}"); Assert.StrictEqual(1, deserializedValue.Articles.Count); - Assert.StrictEqual("Summary", deserializedValue.Articles[0].Category); - Assert.StrictEqual("Bar Summary", deserializedValue.Articles[0].Title); + Assert.Equal("Summary", deserializedValue.Articles[0].Category); + Assert.Equal("Bar Summary", deserializedValue.Articles[0].Title); } [Fact] @@ -1666,7 +1666,7 @@ public static partial class DataContractJsonSerializerTests { ClassImplementingIXmlSerialiable value = new ClassImplementingIXmlSerialiable() { StringValue = "Foo" }; var deserializedValue = SerializeAndDeserialize(value, @""""""); - Assert.StrictEqual(value.StringValue, deserializedValue.StringValue); + Assert.Equal(value.StringValue, deserializedValue.StringValue); } [Fact] @@ -1674,7 +1674,7 @@ public static partial class DataContractJsonSerializerTests { TypeWithNestedGenericClassImplementingIXmlSerialiable.NestedGenericClassImplementingIXmlSerialiable value = new TypeWithNestedGenericClassImplementingIXmlSerialiable.NestedGenericClassImplementingIXmlSerialiable() { StringValue = "Foo" }; var deserializedValue = SerializeAndDeserialize>(value, @""""""); - Assert.StrictEqual(value.StringValue, deserializedValue.StringValue); + Assert.Equal(value.StringValue, deserializedValue.StringValue); } [Fact] @@ -1710,8 +1710,8 @@ public static partial class DataContractJsonSerializerTests Assert.StrictEqual(2, deserialized.Count); Assert.True(deserialized.ContainsKey("key1")); Assert.True(deserialized.ContainsKey("key2")); - Assert.StrictEqual(dict["key1"], deserialized["key1"]); - Assert.StrictEqual(dict["key2"], deserialized["key2"]); + Assert.Equal(dict["key1"], deserialized["key1"]); + Assert.Equal(dict["key2"], deserialized["key2"]); } [Fact] @@ -1726,7 +1726,7 @@ public static partial class DataContractJsonSerializerTests ms.Seek(0, SeekOrigin.Begin); TypeWithPropertyWithoutDefaultCtor deserializedValue = (TypeWithPropertyWithoutDefaultCtor)dcjs.ReadObject(ms); - Assert.StrictEqual("Foo", deserializedValue.Name); + Assert.Equal("Foo", deserializedValue.Name); Assert.Null(deserializedValue.MemberWithInvalidDataContract); } @@ -1737,8 +1737,8 @@ public static partial class DataContractJsonSerializerTests ReadOnlyCollection value = new ReadOnlyCollection(list); var deserializedValue = SerializeAndDeserialize>(value, @"{""list"":[""Foo"",""Bar""]}"); Assert.StrictEqual(value.Count, deserializedValue.Count); - Assert.StrictEqual(value[0], deserializedValue[0]); - Assert.StrictEqual(value[1], deserializedValue[1]); + Assert.Equal(value[0], deserializedValue[0]); + Assert.Equal(value[1], deserializedValue[1]); } [Fact] @@ -1761,7 +1761,7 @@ public static partial class DataContractJsonSerializerTests var value = new KeyValuePair("FooKey", "FooValue"); var deserializedValue = SerializeAndDeserialize>(value, @"{""key"":""FooKey"",""value"":""FooValue""}"); - Assert.StrictEqual(value.Key, deserializedValue.Key); + Assert.Equal(value.Key, deserializedValue.Key); Assert.StrictEqual(value.Value, deserializedValue.Value); } @@ -1772,7 +1772,7 @@ public static partial class DataContractJsonSerializerTests var deserializedValue = SerializeAndDeserialize(value, @"{""Name"":""Foo""}"); Assert.NotNull(deserializedValue); - Assert.StrictEqual(value.Name, deserializedValue.Name); + Assert.Equal(value.Name, deserializedValue.Name); } [Fact] @@ -1782,7 +1782,7 @@ public static partial class DataContractJsonSerializerTests var deserializedValue = SerializeAndDeserialize(value, @"{""Name"":""Foo""}"); Assert.NotNull(deserializedValue); - Assert.StrictEqual(value.Name, deserializedValue.Name); + Assert.Equal(value.Name, deserializedValue.Name); } [Fact] @@ -1792,7 +1792,7 @@ public static partial class DataContractJsonSerializerTests var deserializedValue = SerializeAndDeserialize(value, @"{""Name"":""Foo""}"); Assert.NotNull(deserializedValue); - Assert.StrictEqual(value.Name, deserializedValue.Name); + Assert.Equal(value.Name, deserializedValue.Name); } [Fact] @@ -1802,7 +1802,7 @@ public static partial class DataContractJsonSerializerTests var deserializedValue = SerializeAndDeserialize(value, @"{""Name"":""Foo""}"); Assert.NotNull(deserializedValue); - Assert.StrictEqual(value.Name, deserializedValue.Name); + Assert.Equal(value.Name, deserializedValue.Name); } [Fact] @@ -1855,7 +1855,7 @@ public static partial class DataContractJsonSerializerTests }; var actual = SerializeAndDeserialize(obj, @"{""screen_dpi(x:y)"":440,""screen:orientation"":""horizontal""}"); Assert.StrictEqual(obj.ScreenDpi, actual.ScreenDpi); - Assert.StrictEqual(obj.ScreenOrientation, actual.ScreenOrientation); + Assert.Equal(obj.ScreenOrientation, actual.ScreenOrientation); } [Fact] @@ -1885,7 +1885,7 @@ public static partial class DataContractJsonSerializerTests expected.InnerText = "Element innertext"; var actual = SerializeAndDeserialize(expected, @"""Element innertext<\/Element>"""); Assert.NotNull(actual); - Assert.StrictEqual(expected.InnerText, actual.InnerText); + Assert.Equal(expected.InnerText, actual.InnerText); } [Fact] @@ -1902,7 +1902,7 @@ public static partial class DataContractJsonSerializerTests Assert.StrictEqual(expected.Elements.Length, actual.Elements.Length); for (int i = 0; i < expected.Elements.Length; ++i) { - Assert.StrictEqual(expected.Elements[i].InnerText, actual.Elements[i].InnerText); + Assert.Equal(expected.Elements[i].InnerText, actual.Elements[i].InnerText); } } @@ -1944,7 +1944,7 @@ public static partial class DataContractJsonSerializerTests { TypeWithPrimitiveProperties x = new TypeWithPrimitiveProperties { P1 = "abc", P2 = 11 }; TypeWithPrimitiveProperties y = SerializeAndDeserialize(x, "{\"P1\":\"abc\",\"P2\":11}"); - Assert.StrictEqual(x.P1, y.P1); + Assert.Equal(x.P1, y.P1); Assert.StrictEqual(x.P2, y.P2); } @@ -1953,7 +1953,7 @@ public static partial class DataContractJsonSerializerTests { TypeWithPrimitiveFields x = new TypeWithPrimitiveFields { P1 = "abc", P2 = 11 }; TypeWithPrimitiveFields y = SerializeAndDeserialize(x, "{\"P1\":\"abc\",\"P2\":11}"); - Assert.StrictEqual(x.P1, y.P1); + Assert.Equal(x.P1, y.P1); Assert.StrictEqual(x.P2, y.P2); } @@ -1983,7 +1983,7 @@ public static partial class DataContractJsonSerializerTests Assert.StrictEqual(x.DoubleMember, y.DoubleMember); Assert.StrictEqual(x.FloatMember, y.FloatMember); Assert.StrictEqual(x.GuidMember, y.GuidMember); - Assert.StrictEqual(x.StringMember, y.StringMember); + Assert.Equal(x.StringMember, y.StringMember); Assert.StrictEqual(x.IntMember, y.IntMember); } diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs index 0d2de41..434f24c 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs @@ -210,12 +210,12 @@ public static partial class DataContractSerializerTests [Fact] public static void DCS_StringAsRoot() { - Assert.StrictEqual("abc", DataContractSerializerHelper.SerializeAndDeserialize("abc", @"abc")); - Assert.StrictEqual(" a b ", DataContractSerializerHelper.SerializeAndDeserialize(" a b ", @" a b ")); + Assert.Equal("abc", DataContractSerializerHelper.SerializeAndDeserialize("abc", @"abc")); + Assert.Equal(" a b ", DataContractSerializerHelper.SerializeAndDeserialize(" a b ", @" a b ")); Assert.Null(DataContractSerializerHelper.SerializeAndDeserialize(null, @"")); - Assert.StrictEqual("", DataContractSerializerHelper.SerializeAndDeserialize("", @"")); - Assert.StrictEqual(" ", DataContractSerializerHelper.SerializeAndDeserialize(" ", @" ")); - Assert.StrictEqual("Hello World! 漢 ñ", DataContractSerializerHelper.SerializeAndDeserialize("Hello World! 漢 ñ", @"Hello World! 漢 ñ")); + Assert.Equal("", DataContractSerializerHelper.SerializeAndDeserialize("", @"")); + Assert.Equal(" ", DataContractSerializerHelper.SerializeAndDeserialize(" ", @" ")); + Assert.Equal("Hello World! 漢 ñ", DataContractSerializerHelper.SerializeAndDeserialize("Hello World! 漢 ñ", @"Hello World! 漢 ñ")); } [Fact] @@ -673,7 +673,7 @@ public static partial class DataContractSerializerTests Assert.True(y.Count == 2); string actual = string.Join("", y); - Assert.StrictEqual("a1a2", actual); + Assert.Equal("a1a2", actual); } [Fact] @@ -846,7 +846,7 @@ public static partial class DataContractSerializerTests IDMA_1 x = new IDMA_1 { MyDataMember = "MyDataMember", MyIgnoreDataMember = "MyIgnoreDataMember", MyUnsetDataMember = "MyUnsetDataMember" }; IDMA_1 y = DataContractSerializerHelper.SerializeAndDeserialize(x, @"MyDataMember"); Assert.NotNull(y); - Assert.StrictEqual(x.MyDataMember, y.MyDataMember); + Assert.Equal(x.MyDataMember, y.MyDataMember); Assert.Null(y.MyIgnoreDataMember); Assert.Null(y.MyUnsetDataMember); } @@ -898,7 +898,7 @@ public static partial class DataContractSerializerTests Assert.NotNull(y); Assert.StrictEqual(1, y.Count); Assert.True(y["Key1"] is Dictionary); - Assert.StrictEqual("subkey1value", ((y["Key1"] as Dictionary)["subkey1"]) as string); + Assert.Equal("subkey1value", ((y["Key1"] as Dictionary)["subkey1"]) as string); } [Fact] @@ -931,7 +931,7 @@ public static partial class DataContractSerializerTests }; var actual = DataContractSerializerHelper.SerializeAndDeserialize(obj, "440horizontal"); Assert.StrictEqual(obj.ScreenDpi, actual.ScreenDpi); - Assert.StrictEqual(obj.ScreenOrientation, actual.ScreenOrientation); + Assert.Equal(obj.ScreenOrientation, actual.ScreenOrientation); } [Fact] @@ -971,8 +971,8 @@ public static partial class DataContractSerializerTests var x = new TypeHasArrayOfASerializedAsB(true); var y = DataContractSerializerHelper.SerializeAndDeserialize(x, @"typeAValuetypeBValue"); - Assert.StrictEqual(x.Items[0].Name, y.Items[0].Name); - Assert.StrictEqual(x.Items[1].Name, y.Items[1].Name); + Assert.Equal(x.Items[0].Name, y.Items[0].Name); + Assert.Equal(x.Items[1].Name, y.Items[1].Name); } [Fact] @@ -981,7 +981,7 @@ public static partial class DataContractSerializerTests var x = new WithDuplicateNames(true); var y = DataContractSerializerHelper.SerializeAndDeserialize(x, @"Hello World! 漢 ñtwodos"); - Assert.StrictEqual(x.ClassA1.Name, y.ClassA1.Name); + Assert.Equal(x.ClassA1.Name, y.ClassA1.Name); Assert.StrictEqual(x.StructA1, y.StructA1); Assert.StrictEqual(x.EnumA1, y.EnumA1); Assert.StrictEqual(x.EnumA2, y.EnumA2); @@ -1010,12 +1010,12 @@ public static partial class DataContractSerializerTests private static void VerifyXElementObject(XElement x1, XElement x2, bool checkFirstAttribute = true) { - Assert.StrictEqual(x1.Value, x2.Value); + Assert.Equal(x1.Value, x2.Value); Assert.StrictEqual(x1.Name, x2.Name); if (checkFirstAttribute) { Assert.StrictEqual(x1.FirstAttribute.Name, x2.FirstAttribute.Name); - Assert.StrictEqual(x1.FirstAttribute.Value, x2.FirstAttribute.Value); + Assert.Equal(x1.FirstAttribute.Value, x2.FirstAttribute.Value); } } @@ -1059,11 +1059,11 @@ public static partial class DataContractSerializerTests var x = new DerivedTypeWithDifferentOverrides() { Name1 = "Name1", Name2 = "Name2", Name3 = "Name3", Name4 = "Name4", Name5 = "Name5" }; var y = DataContractSerializerHelper.SerializeAndDeserialize(x, @"Name1Name2Name3Name5"); - Assert.StrictEqual(x.Name1, y.Name1); - Assert.StrictEqual(x.Name2, y.Name2); - Assert.StrictEqual(x.Name3, y.Name3); + Assert.Equal(x.Name1, y.Name1); + Assert.Equal(x.Name2, y.Name2); + Assert.Equal(x.Name3, y.Name3); Assert.Null(y.Name4); - Assert.StrictEqual(x.Name5, y.Name5); + Assert.Equal(x.Name5, y.Name5); } [Fact] @@ -1072,7 +1072,7 @@ public static partial class DataContractSerializerTests var x = new __TypeNameWithSpecialCharacters漢ñ() { PropertyNameWithSpecialCharacters漢ñ = "Test" }; var y = DataContractSerializerHelper.SerializeAndDeserialize<__TypeNameWithSpecialCharacters漢ñ>(x, @"<__TypeNameWithSpecialCharacters漢ñ xmlns=""http://schemas.datacontract.org/2004/07/SerializationTypes"" xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"">Test"); - Assert.StrictEqual(x.PropertyNameWithSpecialCharacters漢ñ, y.PropertyNameWithSpecialCharacters漢ñ); + Assert.Equal(x.PropertyNameWithSpecialCharacters漢ñ, y.PropertyNameWithSpecialCharacters漢ñ); } [Fact] @@ -1204,12 +1204,12 @@ public static partial class DataContractSerializerTests Assert.StrictEqual(value.DateTimeProperty, actual.DateTimeProperty); Assert.StrictEqual(value.IntProperty, actual.IntProperty); - Assert.StrictEqual(value.StringProperty, actual.StringProperty); + Assert.Equal(value.StringProperty, actual.StringProperty); Assert.NotNull(actual.ListProperty); Assert.True(value.ListProperty.Count == actual.ListProperty.Count); - Assert.StrictEqual("one", actual.ListProperty[0]); - Assert.StrictEqual("two", actual.ListProperty[1]); - Assert.StrictEqual("three", actual.ListProperty[2]); + Assert.Equal("one", actual.ListProperty[0]); + Assert.Equal("two", actual.ListProperty[1]); + Assert.Equal("three", actual.ListProperty[2]); } [Fact] @@ -1257,8 +1257,8 @@ public static partial class DataContractSerializerTests var actual = DataContractSerializerHelper.SerializeAndDeserialize(value, @"DisplayNameId"); - Assert.StrictEqual(value.DisplayName, actual.DisplayName); - Assert.StrictEqual(value.Id, actual.Id); + Assert.Equal(value.DisplayName, actual.DisplayName); + Assert.Equal(value.Id, actual.Id); } [Fact] @@ -1351,7 +1351,7 @@ public static partial class DataContractSerializerTests Func serializerFactory = () => new DataContractSerializer(typeof(MyOtherType), "ChangedRoot", "http://changedNamespace"); string baselineXml = @"Hello"; var result = DataContractSerializerHelper.SerializeAndDeserialize(obj, baselineXml, serializerFactory: serializerFactory); - Assert.StrictEqual("Hello", result.Str); + Assert.Equal("Hello", result.Str); } [Fact] @@ -1363,7 +1363,7 @@ public static partial class DataContractSerializerTests Func serializerFactory = () => new DataContractSerializer(typeof(MyOtherType), xmlDictionary.Add("ChangedRoot"), xmlDictionary.Add("http://changedNamespace")); string baselineXml = @"Hello"; var result = DataContractSerializerHelper.SerializeAndDeserialize(obj, baselineXml, serializerFactory: serializerFactory); - Assert.StrictEqual("Hello", result.Str); + Assert.Equal("Hello", result.Str); } [Fact] @@ -1377,7 +1377,7 @@ public static partial class DataContractSerializerTests Assert.StrictEqual((MyEnum)value.EnumValue, (MyEnum)actual.EnumValue); Assert.True(actual.SimpleTypeValue is SimpleKnownTypeValue); - Assert.StrictEqual("PropertyValue", ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); + Assert.Equal("PropertyValue", ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); } [Fact] @@ -1406,7 +1406,7 @@ public static partial class DataContractSerializerTests Assert.StrictEqual((MyEnum)value.EnumValue, (MyEnum)actual.EnumValue); Assert.True(actual.SimpleTypeValue is SimpleKnownTypeValue); - Assert.StrictEqual("PropertyValue", ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); + Assert.Equal("PropertyValue", ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); } [Fact] @@ -1420,7 +1420,7 @@ public static partial class DataContractSerializerTests Assert.StrictEqual((MyEnum)value.EnumValue, (MyEnum)actual.EnumValue); Assert.True(actual.SimpleTypeValue is SimpleKnownTypeValue); - Assert.StrictEqual("PropertyValue", ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); + Assert.Equal("PropertyValue", ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); } [Fact] @@ -1435,7 +1435,7 @@ public static partial class DataContractSerializerTests Assert.StrictEqual((MyEnum)value.EnumValue, (MyEnum)actual.EnumValue); Assert.True(actual.SimpleTypeValue is SimpleKnownTypeValue); - Assert.StrictEqual("PropertyValue", ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); + Assert.Equal("PropertyValue", ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); } [Fact] @@ -1444,11 +1444,11 @@ public static partial class DataContractSerializerTests var value = new Exception("Test Exception"); var actual = DataContractSerializerHelper.SerializeAndDeserialize(value, @"System.ExceptionTest Exception0-2146233088"); - Assert.StrictEqual(value.Message, actual.Message); - Assert.StrictEqual(value.Source, actual.Source); - Assert.StrictEqual(value.StackTrace, actual.StackTrace); + Assert.Equal(value.Message, actual.Message); + Assert.Equal(value.Source, actual.Source); + Assert.Equal(value.StackTrace, actual.StackTrace); Assert.StrictEqual(value.HResult, actual.HResult); - Assert.StrictEqual(value.HelpLink, actual.HelpLink); + Assert.Equal(value.HelpLink, actual.HelpLink); } [Fact] @@ -1457,12 +1457,12 @@ public static partial class DataContractSerializerTests var value = new MyArgumentException("Test Exception", "paramName"); var actual = DataContractSerializerHelper.SerializeAndDeserialize(value, @"MyArgumentExceptionTest Exception0-2146233088paramName"); - Assert.StrictEqual(value.Message, actual.Message); - Assert.StrictEqual(value.ParamName, actual.ParamName); - Assert.StrictEqual(value.Source, actual.Source); - Assert.StrictEqual(value.StackTrace, actual.StackTrace); + Assert.Equal(value.Message, actual.Message); + Assert.Equal(value.ParamName, actual.ParamName); + Assert.Equal(value.Source, actual.Source); + Assert.Equal(value.StackTrace, actual.StackTrace); Assert.StrictEqual(value.HResult, actual.HResult); - Assert.StrictEqual(value.HelpLink, actual.HelpLink); + Assert.Equal(value.HelpLink, actual.HelpLink); } [Fact] @@ -1471,11 +1471,11 @@ public static partial class DataContractSerializerTests var value = new Exception("Test Exception<>&'\""); var actual = DataContractSerializerHelper.SerializeAndDeserialize(value, @"System.ExceptionTest Exception<>&'""0-2146233088"); - Assert.StrictEqual(value.Message, actual.Message); - Assert.StrictEqual(value.Source, actual.Source); - Assert.StrictEqual(value.StackTrace, actual.StackTrace); + Assert.Equal(value.Message, actual.Message); + Assert.Equal(value.Source, actual.Source); + Assert.Equal(value.StackTrace, actual.StackTrace); Assert.StrictEqual(value.HResult, actual.HResult); - Assert.StrictEqual(value.HelpLink, actual.HelpLink); + Assert.Equal(value.HelpLink, actual.HelpLink); } [Fact] @@ -1484,17 +1484,17 @@ public static partial class DataContractSerializerTests var value = new Exception("", new Exception("Test Exception<>&'\"")); var actual = DataContractSerializerHelper.SerializeAndDeserialize(value, @"System.ExceptionSystem.ExceptionTest Exception<>&'""0-21462330880-2146233088"); - Assert.StrictEqual(value.Message, actual.Message); - Assert.StrictEqual(value.Source, actual.Source); - Assert.StrictEqual(value.StackTrace, actual.StackTrace); + Assert.Equal(value.Message, actual.Message); + Assert.Equal(value.Source, actual.Source); + Assert.Equal(value.StackTrace, actual.StackTrace); Assert.StrictEqual(value.HResult, actual.HResult); - Assert.StrictEqual(value.HelpLink, actual.HelpLink); + Assert.Equal(value.HelpLink, actual.HelpLink); - Assert.StrictEqual(value.InnerException.Message, actual.InnerException.Message); - Assert.StrictEqual(value.InnerException.Source, actual.InnerException.Source); - Assert.StrictEqual(value.InnerException.StackTrace, actual.InnerException.StackTrace); + Assert.Equal(value.InnerException.Message, actual.InnerException.Message); + Assert.Equal(value.InnerException.Source, actual.InnerException.Source); + Assert.Equal(value.InnerException.StackTrace, actual.InnerException.StackTrace); Assert.StrictEqual(value.InnerException.HResult, actual.InnerException.HResult); - Assert.StrictEqual(value.InnerException.HelpLink, actual.InnerException.HelpLink); + Assert.Equal(value.InnerException.HelpLink, actual.InnerException.HelpLink); } [Fact] @@ -1691,7 +1691,7 @@ public static partial class DataContractSerializerTests TypeWithTypeProperty value = new TypeWithTypeProperty { Id = 123, Name = "Jon Doe" }; var deserializedValue = DataContractSerializerHelper.SerializeAndDeserialize(value, @"123Jon Doe"); Assert.StrictEqual(value.Id, deserializedValue.Id); - Assert.StrictEqual(value.Name, deserializedValue.Name); + Assert.Equal(value.Name, deserializedValue.Name); Assert.StrictEqual(value.Type, deserializedValue.Type); } @@ -1705,9 +1705,9 @@ public static partial class DataContractSerializerTests Assert.StrictEqual(2, deserializedValue.Count); IEnumerator enumerator = ((IEnumerable)deserializedValue).GetEnumerator(); enumerator.MoveNext(); - Assert.StrictEqual("Foo", (string)enumerator.Current); + Assert.Equal("Foo", (string)enumerator.Current); enumerator.MoveNext(); - Assert.StrictEqual("Bar", (string)enumerator.Current); + Assert.Equal("Bar", (string)enumerator.Current); } [Fact] @@ -1719,9 +1719,9 @@ public static partial class DataContractSerializerTests var deserializedValue = DataContractSerializerHelper.SerializeAndDeserialize(value, @"101Foo202Bar"); Assert.StrictEqual(2, deserializedValue.Foo.Count); - Assert.StrictEqual("Foo", deserializedValue.Foo[10].Name); + Assert.Equal("Foo", deserializedValue.Foo[10].Name); Assert.StrictEqual(1, deserializedValue.Foo[10].LevelNo); - Assert.StrictEqual("Bar", deserializedValue.Foo[20].Name); + Assert.Equal("Bar", deserializedValue.Foo[20].Name); Assert.StrictEqual(2, deserializedValue.Foo[20].LevelNo); } @@ -1732,8 +1732,8 @@ public static partial class DataContractSerializerTests value.HeadLine = new NewsArticle() { Title = "Foo News" }; var deserializedValue = DataContractSerializerHelper.SerializeAndDeserialize(value, @"NewsFoo News"); - Assert.StrictEqual("News", deserializedValue.HeadLine.Category); - Assert.StrictEqual("Foo News", deserializedValue.HeadLine.Title); + Assert.Equal("News", deserializedValue.HeadLine.Category); + Assert.Equal("Foo News", deserializedValue.HeadLine.Title); } [Fact] @@ -1744,8 +1744,8 @@ public static partial class DataContractSerializerTests var deserializedValue = DataContractSerializerHelper.SerializeAndDeserialize(value, @"SummaryBar Summary"); Assert.StrictEqual(1, deserializedValue.Articles.Count); - Assert.StrictEqual("Summary", deserializedValue.Articles[0].Category); - Assert.StrictEqual("Bar Summary", deserializedValue.Articles[0].Title); + Assert.Equal("Summary", deserializedValue.Articles[0].Category); + Assert.Equal("Bar Summary", deserializedValue.Articles[0].Title); } /* @@ -1793,7 +1793,7 @@ public static partial class DataContractSerializerTests DerivedTypeWithDataMemberInBaseType value = new DerivedTypeWithDataMemberInBaseType() { EmbeddedDataMember = new TypeAsEmbeddedDataMember { Name = "Foo" } }; var deserializedValue = DataContractSerializerHelper.SerializeAndDeserialize(value, @"Foo"); - Assert.StrictEqual("Foo", deserializedValue.EmbeddedDataMember.Name); + Assert.Equal("Foo", deserializedValue.EmbeddedDataMember.Name); } [Fact] @@ -1802,7 +1802,7 @@ public static partial class DataContractSerializerTests PocoDerivedTypeWithDataMemberInBaseType value = new PocoDerivedTypeWithDataMemberInBaseType() { EmbeddedDataMember = new PocoTypeAsEmbeddedDataMember { Name = "Foo" } }; var deserializedValue = DataContractSerializerHelper.SerializeAndDeserialize(value, @"Foo"); - Assert.StrictEqual("Foo", deserializedValue.EmbeddedDataMember.Name); + Assert.Equal("Foo", deserializedValue.EmbeddedDataMember.Name); } [Fact] @@ -1810,7 +1810,7 @@ public static partial class DataContractSerializerTests { ClassImplementingIXmlSerialiable value = new ClassImplementingIXmlSerialiable() { StringValue = "Foo" }; var deserializedValue = DataContractSerializerHelper.SerializeAndDeserialize(value, @""); - Assert.StrictEqual(value.StringValue, deserializedValue.StringValue); + Assert.Equal(value.StringValue, deserializedValue.StringValue); } [Fact] @@ -1818,7 +1818,7 @@ public static partial class DataContractSerializerTests { TypeWithNestedGenericClassImplementingIXmlSerialiable.NestedGenericClassImplementingIXmlSerialiable value = new TypeWithNestedGenericClassImplementingIXmlSerialiable.NestedGenericClassImplementingIXmlSerialiable() { StringValue = "Foo" }; var deserializedValue = DataContractSerializerHelper.SerializeAndDeserialize>(value, @""); - Assert.StrictEqual(value.StringValue, deserializedValue.StringValue); + Assert.Equal(value.StringValue, deserializedValue.StringValue); } [Fact] @@ -1866,7 +1866,7 @@ public static partial class DataContractSerializerTests ms.Seek(0, SeekOrigin.Begin); TypeWithPropertyWithoutDefaultCtor deserializedValue = (TypeWithPropertyWithoutDefaultCtor)dcs.ReadObject(ms); - Assert.StrictEqual("Foo", deserializedValue.Name); + Assert.Equal("Foo", deserializedValue.Name); Assert.Null(deserializedValue.MemberWithInvalidDataContract); } @@ -1877,8 +1877,8 @@ public static partial class DataContractSerializerTests ReadOnlyCollection value = new ReadOnlyCollection(list); var deserializedValue = DataContractSerializerHelper.SerializeAndDeserialize>(value, @"FooBar"); Assert.StrictEqual(value.Count, deserializedValue.Count); - Assert.StrictEqual(value[0], deserializedValue[0]); - Assert.StrictEqual(value[1], deserializedValue[1]); + Assert.Equal(value[0], deserializedValue[0]); + Assert.Equal(value[1], deserializedValue[1]); } [Fact] @@ -1901,7 +1901,7 @@ public static partial class DataContractSerializerTests var value = new KeyValuePair("FooKey", "FooValue"); var deserializedValue = DataContractSerializerHelper.SerializeAndDeserialize>(value, @"FooKeyFooValue"); - Assert.StrictEqual(value.Key, deserializedValue.Key); + Assert.Equal(value.Key, deserializedValue.Key); Assert.StrictEqual(value.Value, deserializedValue.Value); } @@ -1926,7 +1926,7 @@ public static partial class DataContractSerializerTests var deserializedValue = DataContractSerializerHelper.SerializeAndDeserialize(value, @"Foo"); Assert.NotNull(deserializedValue); - Assert.StrictEqual(value.Name, deserializedValue.Name); + Assert.Equal(value.Name, deserializedValue.Name); } [Fact] @@ -1936,7 +1936,7 @@ public static partial class DataContractSerializerTests var deserializedValue = DataContractSerializerHelper.SerializeAndDeserialize(value, @"Foo"); Assert.NotNull(deserializedValue); - Assert.StrictEqual(value.Name, deserializedValue.Name); + Assert.Equal(value.Name, deserializedValue.Name); } [Fact] @@ -1946,7 +1946,7 @@ public static partial class DataContractSerializerTests var deserializedValue = DataContractSerializerHelper.SerializeAndDeserialize(value, @"Foo"); Assert.NotNull(deserializedValue); - Assert.StrictEqual(value.Name, deserializedValue.Name); + Assert.Equal(value.Name, deserializedValue.Name); } [Fact] @@ -1956,7 +1956,7 @@ public static partial class DataContractSerializerTests var deserializedValue = DataContractSerializerHelper.SerializeAndDeserialize(value, @"Foo"); Assert.NotNull(deserializedValue); - Assert.StrictEqual(value.Name, deserializedValue.Name); + Assert.Equal(value.Name, deserializedValue.Name); } [Fact] @@ -2042,7 +2042,7 @@ public static partial class DataContractSerializerTests { var deserializedObject = (TypeWithTypeWithIntAndStringPropertyProperty)serializer.ReadObject(reader); Assert.StrictEqual(10, deserializedObject.ObjectProperty.SampleInt); - Assert.StrictEqual("Sample string", deserializedObject.ObjectProperty.SampleString); + Assert.Equal("Sample string", deserializedObject.ObjectProperty.SampleString); } else { @@ -2101,7 +2101,7 @@ public static partial class DataContractSerializerTests var actual = DataContractSerializerHelper.SerializeAndDeserialize(expected, @"Element innertext"); Assert.NotNull(actual); - Assert.StrictEqual(expected.InnerText, actual.InnerText); + Assert.Equal(expected.InnerText, actual.InnerText); } [Fact] @@ -2119,7 +2119,7 @@ public static partial class DataContractSerializerTests Assert.StrictEqual(expected.Elements.Length, actual.Elements.Length); for (int i = 0; i < expected.Elements.Length; ++i) { - Assert.StrictEqual(expected.Elements[i].InnerText, actual.Elements[i].InnerText); + Assert.Equal(expected.Elements[i].InnerText, actual.Elements[i].InnerText); } } @@ -2246,7 +2246,7 @@ public static partial class DataContractSerializerTests { TypeWithPrimitiveProperties x = new TypeWithPrimitiveProperties { P1 = "abc", P2 = 11 }; TypeWithPrimitiveProperties y = DataContractSerializerHelper.SerializeAndDeserialize(x, @"abc11"); - Assert.StrictEqual(x.P1, y.P1); + Assert.Equal(x.P1, y.P1); Assert.StrictEqual(x.P2, y.P2); } @@ -2255,7 +2255,7 @@ public static partial class DataContractSerializerTests { TypeWithPrimitiveFields x = new TypeWithPrimitiveFields { P1 = "abc", P2 = 11 }; TypeWithPrimitiveFields y = DataContractSerializerHelper.SerializeAndDeserialize(x, @"abc11"); - Assert.StrictEqual(x.P1, y.P1); + Assert.Equal(x.P1, y.P1); Assert.StrictEqual(x.P2, y.P2); } @@ -2285,7 +2285,7 @@ public static partial class DataContractSerializerTests Assert.StrictEqual(x.DoubleMember, y.DoubleMember); Assert.StrictEqual(x.FloatMember, y.FloatMember); Assert.StrictEqual(x.GuidMember, y.GuidMember); - Assert.StrictEqual(x.StringMember, y.StringMember); + Assert.Equal(x.StringMember, y.StringMember); Assert.StrictEqual(x.IntMember, y.IntMember); } @@ -3864,7 +3864,7 @@ public static partial class DataContractSerializerTests Assert.StrictEqual(myFamily.Members.Length, newFamily.Members.Length); for (int i = 0; i < myFamily.Members.Length; ++i) { - Assert.StrictEqual(myFamily.Members[i].Name, newFamily.Members[i].Name); + Assert.Equal(myFamily.Members[i].Name, newFamily.Members[i].Name); } } @@ -3899,7 +3899,7 @@ public static partial class DataContractSerializerTests using (var stream2 = (MyFileStream)dcs.ReadObject(stream)) { string fileData = stream2.ReadLine(); - Assert.StrictEqual(TestFileData, fileData); + Assert.Equal(TestFileData, fileData); } } } diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializerStressTests.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializerStressTests.cs index 6b45827..db57a7b 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializerStressTests.cs +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializerStressTests.cs @@ -53,7 +53,7 @@ public static partial class DataContractSerializerTests Assert.StrictEqual(myFamily.Members.Length, newFamily.Members.Length); for (int i = 0; i < myFamily.Members.Length; ++i) { - Assert.StrictEqual(myFamily.Members[i].Name, newFamily.Members[i].Name); + Assert.Equal(myFamily.Members[i].Name, newFamily.Members[i].Name); } var resultMembers = newFamily.Members; diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryReaderTests.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryReaderTests.cs index dbf6d8f..5871d07 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryReaderTests.cs +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryReaderTests.cs @@ -59,7 +59,7 @@ namespace System.Runtime.Serialization.Xml.Tests returnedString = new string(resultChars.ToArray()); } - Assert.StrictEqual(testString, returnedString); + Assert.Equal(testString, returnedString); } } } @@ -87,7 +87,7 @@ namespace System.Runtime.Serialization.Xml.Tests returnedString = xmlReader.ReadElementContentAsString(); } - Assert.StrictEqual(testString, returnedString); + Assert.Equal(testString, returnedString); } [Fact] diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs index cf86659..c7f1fce 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs @@ -37,7 +37,7 @@ public static class XmlDictionaryWriterTest actual = sr.ReadToEnd(); } - Assert.StrictEqual(expect, actual); + Assert.Equal(expect, actual); } [Fact] @@ -59,7 +59,7 @@ public static class XmlDictionaryWriterTest actual = sr.ReadToEnd(); } - Assert.StrictEqual(expect, actual); + Assert.Equal(expect, actual); } [Fact] @@ -111,7 +111,7 @@ public static class XmlDictionaryWriterTest Assert.True(false, sb.ToString()); } - Assert.StrictEqual(expect, actual); + Assert.Equal(expect, actual); } @@ -139,7 +139,7 @@ public static class XmlDictionaryWriterTest actual = sr.ReadToEnd(); } - Assert.StrictEqual(expect, actual); + Assert.Equal(expect, actual); } [Fact] -- 2.7.4