Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Moved UnitySerializationHolder serialization test to System.Runtime.T…
Browse files Browse the repository at this point in the history
…ests
  • Loading branch information
ViktorHofer committed Sep 12, 2017
1 parent 34da99c commit 576ee21
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,6 @@ private static void ValidateAndRoundtrip(object obj, string[] blobs, bool isEqua
}
}

[Fact]
public void UnitySerializationHolderWithAssemblySingleton()
{
const string UnitySerializationHolderAssemblyBase64String = "AAEAAAD/////AQAAAAAAAAAEAQAAAB9TeXN0ZW0uVW5pdHlTZXJpYWxpemF0aW9uSG9sZGVyAwAAAAREYXRhCVVuaXR5VHlwZQxBc3NlbWJseU5hbWUBAAEIBgIAAABLbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BgAAAAkCAAAACw==";
AssertExtensions.ThrowsIf<ArgumentException>(!PlatformDetection.IsFullFramework,
() => DeserializeBlobToObject(UnitySerializationHolderAssemblyBase64String, FormatterAssemblyStyle.Full));
}

[Fact]
public void ArraySegmentDefaultCtor()
{
Expand Down
3 changes: 2 additions & 1 deletion src/System.Runtime/tests/System.Runtime.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
<Compile Include="System\UInt32Tests.cs" />
<Compile Include="System\UInt64Tests.cs" />
<Compile Include="System\UIntPtrTests.cs" />
<Compile Include="System\UnitySerializationHolderTests.cs" />
<Compile Include="System\Uri.CreateStringTests.cs" />
<Compile Include="System\Uri.CreateUriTests.cs" />
<Compile Include="System\Uri.MethodsTests.cs" />
Expand Down Expand Up @@ -261,4 +262,4 @@
<EmbeddedResource Include="Resources\$(AssemblyName).rd.xml" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>
</Project>
20 changes: 20 additions & 0 deletions src/System.Runtime/tests/System/UnitySerializationHolderTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// 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.Runtime.Serialization.Formatters.Tests;
using Xunit;

namespace System.Tests
{
public class UnitySerializationHolderTests
{
[Fact]
public void UnitySerializationHolderWithAssemblySingleton()
{
const string UnitySerializationHolderAssemblyBase64String = "AAEAAAD/////AQAAAAAAAAAEAQAAAB9TeXN0ZW0uVW5pdHlTZXJpYWxpemF0aW9uSG9sZGVyAwAAAAREYXRhCVVuaXR5VHlwZQxBc3NlbWJseU5hbWUBAAEIBgIAAABLbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BgAAAAkCAAAACw==";
AssertExtensions.ThrowsIf<ArgumentException>(!PlatformDetection.IsFullFramework,
() => BinaryFormatterHelpers.FromBase64String(UnitySerializationHolderAssemblyBase64String));
}
}
}

0 comments on commit 576ee21

Please sign in to comment.