diff options
author | Viktor Hofer <viktor.hofer@microsoft.com> | 2017-08-01 00:48:06 +0300 |
---|---|---|
committer | Stephen Toub <stoub@microsoft.com> | 2017-08-01 00:48:06 +0300 |
commit | da047240f65309f45b477e31c8e63ca3f06b80f0 (patch) | |
tree | 4f57d61dabb8dd14b25b2383de1a2d9fd2b1a438 /src/System.Drawing.Primitives | |
parent | 9b13e7f1100c83446153811ddc82e7ddc2fd57da (diff) |
Remove unused serialization members (#22785)
* Remove unused serialization members
* Remove unused S.Security.Permissions serialization test code
* Remove duplicate test code. S.Drawing.Primitive type serialization is already throughly tested in S.Runtime.Serialization.Formatters.Tests
* Remove ConcurrentBag unused serialization code
* Removing unused Principal/Identity serialization code
Diffstat (limited to 'src/System.Drawing.Primitives')
-rw-r--r-- | src/System.Drawing.Primitives/tests/SerializationTests.cs | 55 | ||||
-rw-r--r-- | src/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj | 4 |
2 files changed, 0 insertions, 59 deletions
diff --git a/src/System.Drawing.Primitives/tests/SerializationTests.cs b/src/System.Drawing.Primitives/tests/SerializationTests.cs deleted file mode 100644 index 30cc4d5ec8..0000000000 --- a/src/System.Drawing.Primitives/tests/SerializationTests.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Collections.Generic; -using System.Runtime.Serialization.Formatters.Tests; -using Xunit; - -namespace System.Drawing.Primitives.Tests -{ - public class SerializationTests - { - public static IEnumerable<object[]> Color_Roundtrip_MemberData() - { - yield return new object[] { default(Color) }; - yield return new object[] { Color.FromName("AliceBlue") }; - yield return new object[] { Color.AliceBlue }; - yield return new object[] { Color.FromArgb(255, 1, 2, 3) }; - yield return new object[] { Color.FromArgb(0, 1, 2, 3) }; - yield return new object[] { Color.FromArgb(1, 2, 3) }; - yield return new object[] { Color.FromName("SomeName") }; - } - - [Theory] - [MemberData(nameof(Color_Roundtrip_MemberData))] - public void Color_Roundtrip(Color c) - { - Assert.Equal(c, BinaryFormatterHelpers.Clone(c)); - } - - [Fact] - public void Size_Roundtrip() - { - SizeF s = new SizeF(123.4f, 567.8f); - Assert.Equal(s, BinaryFormatterHelpers.Clone(s)); - Assert.Equal(s.ToSize(), BinaryFormatterHelpers.Clone(s.ToSize())); - } - - [Fact] - public void Point_Roundtrip() - { - PointF p = new PointF(123.4f, 567.8f); - Assert.Equal(p, BinaryFormatterHelpers.Clone(p)); - Assert.Equal(Point.Truncate(p), BinaryFormatterHelpers.Clone(Point.Truncate(p))); - } - - [Fact] - public void Rectangle_Roundtrip() - { - RectangleF r = new RectangleF(1.2f, 3.4f, 5.6f, 7.8f); - Assert.Equal(r, BinaryFormatterHelpers.Clone(r)); - Assert.Equal(Rectangle.Truncate(r), BinaryFormatterHelpers.Clone(Rectangle.Truncate(r))); - } - } -} diff --git a/src/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj b/src/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj index 29a26cc198..c71bb1e334 100644 --- a/src/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj +++ b/src/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj @@ -19,16 +19,12 @@ <Compile Include="SizeFTests.cs" /> <Compile Include="SizeTests.cs" /> <Compile Include="ColorTests.cs" /> - <Compile Include="SerializationTests.cs" /> <Compile Include="$(CommonTestPath)\System\PlatformDetection.cs"> <Link>Common\System\PlatformDetection.cs</Link> </Compile> <Compile Include="$(CommonTestPath)\System\Diagnostics\DebuggerAttributes.cs"> <Link>Common\System\Diagnostics\DebuggerAttributes.cs</Link> </Compile> - <Compile Include="$(CommonTestPath)\System\Runtime\Serialization\Formatters\BinaryFormatterHelpers.cs"> - <Link>Common\System\Runtime\Serialization\Formatters\BinaryFormatterHelpers.cs</Link> - </Compile> </ItemGroup> <ItemGroup Condition="'$(TargetGroup)'=='netcoreapp'"> <Compile Include="SizeFTests.netcoreapp.cs" /> |