Skip to content

Commit f0618bb

Browse files
committed
Add silverlight5 unit test.
1 parent 6834e40 commit f0618bb

34 files changed

Lines changed: 4820 additions & 80 deletions

MsgPack.Windows.sln

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MsgPack.UnitTest.Uwp", "tes
5656
EndProject
5757
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MsgPack.UnitTest.Uwp.Aot", "test\MsgPack.UnitTest.Uwp.Aot\MsgPack.UnitTest.Uwp.Aot.csproj", "{E4CA9866-6234-49D4-8CDF-1F3A21EFD138}"
5858
EndProject
59+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MsgPack.UnitTest.Silverlight.5", "test\MsgPack.UnitTest.Silverlight.5\MsgPack.UnitTest.Silverlight.5.csproj", "{17D0F223-E156-42CF-ACA8-815733FE094F}"
60+
EndProject
5961
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.framework-sl-5.0", "test\NUnitLite\NUnitFramework\framework\nunit.framework-sl-5.0.csproj", "{3DEB15F9-E7DA-403F-B6D3-A8499310397F}"
6062
EndProject
6163
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunitlite-sl-5.0", "test\NUnitLite\NUnitFramework\nunitlite\nunitlite-sl-5.0.csproj", "{0A5F920A-1BF5-4DAC-B799-0C618B203797}"
@@ -528,6 +530,46 @@ Global
528530
{E4CA9866-6234-49D4-8CDF-1F3A21EFD138}.Release|x86.ActiveCfg = Release|x86
529531
{E4CA9866-6234-49D4-8CDF-1F3A21EFD138}.Release|x86.Build.0 = Release|x86
530532
{E4CA9866-6234-49D4-8CDF-1F3A21EFD138}.Release|x86.Deploy.0 = Release|x86
533+
{17D0F223-E156-42CF-ACA8-815733FE094F}.CodeAnalysis|Any CPU.ActiveCfg = Release|Any CPU
534+
{17D0F223-E156-42CF-ACA8-815733FE094F}.CodeAnalysis|Any CPU.Build.0 = Release|Any CPU
535+
{17D0F223-E156-42CF-ACA8-815733FE094F}.CodeAnalysis|ARM.ActiveCfg = Release|Any CPU
536+
{17D0F223-E156-42CF-ACA8-815733FE094F}.CodeAnalysis|ARM.Build.0 = Release|Any CPU
537+
{17D0F223-E156-42CF-ACA8-815733FE094F}.CodeAnalysis|Mixed Platforms.ActiveCfg = Release|Any CPU
538+
{17D0F223-E156-42CF-ACA8-815733FE094F}.CodeAnalysis|Mixed Platforms.Build.0 = Release|Any CPU
539+
{17D0F223-E156-42CF-ACA8-815733FE094F}.CodeAnalysis|x64.ActiveCfg = Release|Any CPU
540+
{17D0F223-E156-42CF-ACA8-815733FE094F}.CodeAnalysis|x64.Build.0 = Release|Any CPU
541+
{17D0F223-E156-42CF-ACA8-815733FE094F}.CodeAnalysis|x86.ActiveCfg = Release|Any CPU
542+
{17D0F223-E156-42CF-ACA8-815733FE094F}.CodeAnalysis|x86.Build.0 = Release|Any CPU
543+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
544+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Debug|Any CPU.Build.0 = Debug|Any CPU
545+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Debug|ARM.ActiveCfg = Debug|Any CPU
546+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Debug|ARM.Build.0 = Debug|Any CPU
547+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
548+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
549+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Debug|x64.ActiveCfg = Debug|Any CPU
550+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Debug|x64.Build.0 = Debug|Any CPU
551+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Debug|x86.ActiveCfg = Debug|Any CPU
552+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Debug|x86.Build.0 = Debug|Any CPU
553+
{17D0F223-E156-42CF-ACA8-815733FE094F}.PerformanceTest|Any CPU.ActiveCfg = Release|Any CPU
554+
{17D0F223-E156-42CF-ACA8-815733FE094F}.PerformanceTest|Any CPU.Build.0 = Release|Any CPU
555+
{17D0F223-E156-42CF-ACA8-815733FE094F}.PerformanceTest|ARM.ActiveCfg = Release|Any CPU
556+
{17D0F223-E156-42CF-ACA8-815733FE094F}.PerformanceTest|ARM.Build.0 = Release|Any CPU
557+
{17D0F223-E156-42CF-ACA8-815733FE094F}.PerformanceTest|Mixed Platforms.ActiveCfg = Release|Any CPU
558+
{17D0F223-E156-42CF-ACA8-815733FE094F}.PerformanceTest|Mixed Platforms.Build.0 = Release|Any CPU
559+
{17D0F223-E156-42CF-ACA8-815733FE094F}.PerformanceTest|x64.ActiveCfg = Release|Any CPU
560+
{17D0F223-E156-42CF-ACA8-815733FE094F}.PerformanceTest|x64.Build.0 = Release|Any CPU
561+
{17D0F223-E156-42CF-ACA8-815733FE094F}.PerformanceTest|x86.ActiveCfg = Release|Any CPU
562+
{17D0F223-E156-42CF-ACA8-815733FE094F}.PerformanceTest|x86.Build.0 = Release|Any CPU
563+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Release|Any CPU.ActiveCfg = Release|Any CPU
564+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Release|Any CPU.Build.0 = Release|Any CPU
565+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Release|ARM.ActiveCfg = Release|Any CPU
566+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Release|ARM.Build.0 = Release|Any CPU
567+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
568+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
569+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Release|x64.ActiveCfg = Release|Any CPU
570+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Release|x64.Build.0 = Release|Any CPU
571+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Release|x86.ActiveCfg = Release|Any CPU
572+
{17D0F223-E156-42CF-ACA8-815733FE094F}.Release|x86.Build.0 = Release|Any CPU
531573
{3DEB15F9-E7DA-403F-B6D3-A8499310397F}.CodeAnalysis|Any CPU.ActiveCfg = Release|Any CPU
532574
{3DEB15F9-E7DA-403F-B6D3-A8499310397F}.CodeAnalysis|Any CPU.Build.0 = Release|Any CPU
533575
{3DEB15F9-E7DA-403F-B6D3-A8499310397F}.CodeAnalysis|ARM.ActiveCfg = Release|Any CPU
@@ -632,6 +674,7 @@ Global
632674
{A1B322FC-AA39-4894-AFA8-AB427A3FBA09} = {BFCE0B36-F21B-4EB1-919E-C486E70C8BEA}
633675
{0F930636-458B-401F-9EAF-F4F05E93BCC9} = {7D06945C-638C-4973-B0B6-D0D667FA318F}
634676
{E4CA9866-6234-49D4-8CDF-1F3A21EFD138} = {09C98E72-44F7-4469-B82A-DFA3053652E6}
677+
{17D0F223-E156-42CF-ACA8-815733FE094F} = {9600C37E-439F-43D7-9D12-3AB0BEF7D906}
635678
{3DEB15F9-E7DA-403F-B6D3-A8499310397F} = {9600C37E-439F-43D7-9D12-3AB0BEF7D906}
636679
{0A5F920A-1BF5-4DAC-B799-0C618B203797} = {9600C37E-439F-43D7-9D12-3AB0BEF7D906}
637680
EndGlobalSection

Sync.Test.xml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,45 @@
1717
<Exclude File="*.ttinclude" />
1818
</Project>
1919

20+
<Project Name="MsgPack.UnitTest.Silverlight.5" Base="MsgPack.UnitTest">
21+
<Preserve Path="Properties\*" />
22+
<Preserve File="*.config" />
23+
<Preserve File="*.json" />
24+
<Preserve File="*.mpac" />
25+
<Preserve Path="System\*" />
26+
<Preserve Path="System\Collections\Generic\*" />
27+
<Preserve Path="App.xaml" />
28+
<Preserve Path="App.xaml.cs" />
29+
<Exclude Path="gen\*" />
30+
<Exclude Path="Serialization\PreGenerated*" />
31+
<Exclude Path="Serialization\_SetUpFixture.cs" />
32+
<Exclude Path="Serialization\AppendableReadOnlyCollections.cs" />
33+
<Exclude Path="Serialization\ArrayFieldBasedAutoMessagePackSerializerTest.cs" />
34+
<Exclude Path="Serialization\ArrayFieldBasedEnumSerializationTest.cs" />
35+
<Exclude Path="Serialization\ArrayContextBasedAutoMessagePackSerializerTest.cs" />
36+
<Exclude Path="Serialization\ArrayContextBasedEnumSerializationTest.cs" />
37+
<Exclude Path="Serialization\ArrayGenerationBasedAutoMessagePackSerializerTest.cs" />
38+
<Exclude Path="Serialization\ArrayGenerationBasedEnumSerializationTest.cs" />
39+
<Exclude Path="Serialization\CompositeTest.cs" />
40+
<Exclude Path="Serialization\FieldBasedNilImplicationTest.cs" />
41+
<Exclude Path="Serialization\GenerationBasedNilImplicationTest.cs" />
42+
<Exclude Path="Serialization\MapFieldBasedAutoMessagePackSerializerTest.cs" />
43+
<Exclude Path="Serialization\MapFieldBasedEnumSerializationTest.cs" />
44+
<Exclude Path="Serialization\MapContextBasedAutoMessagePackSerializerTest.cs" />
45+
<Exclude Path="Serialization\MapContextBasedEnumSerializationTest.cs" />
46+
<Exclude Path="Serialization\MapGenerationBasedAutoMessagePackSerializerTest.cs" />
47+
<Exclude Path="Serialization\MapGenerationBasedEnumSerializationTest.cs" />
48+
<Exclude Path="Serialization\FromExpressionTest.cs" />
49+
<Exclude Path="Serialization\SerializerGeneratorTest.cs" />
50+
<Exclude Path="Serialization\RoslynCodeGeneration.cs" />
51+
<Exclude Path="Serialization\TempFileDependentAssemblyManager.cs" />
52+
<Exclude Path="_SetUpFixture.cs" />
53+
<Exclude Path="TestSuite.cs" />
54+
<Exclude File="*.ps1" />
55+
<Exclude File="*.tt" />
56+
<Exclude File="*.ttinclude" />
57+
</Project>
58+
2059
<Project Name="MsgPack.UnitTest.Xamarin.iOS" Base="MsgPack.UnitTest">
2160
<Preserve Path="Properties\*" />
2261
<Preserve File="*.config" />

test/MsgPack.UnitTest.CodeDom/Serialization/ArrayCodeDomBasedAutoMessagePackSerializerTest.cs

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@
4141
using System.Numerics;
4242
#endif // !NETFX_35 && !WINDOWS_PHONE
4343
using System.Reflection;
44+
#if !SILVERLIGHT
4445
using System.Runtime.InteropServices.ComTypes;
46+
#endif // !SILVERLIGHT
4547
using System.Runtime.Serialization;
4648
using System.Text;
4749
#if FEATURE_TAP
@@ -52,6 +54,10 @@
5254
using MsgPack.Serialization.CodeDomSerializers;
5355
using MsgPack.Serialization.EmittingSerializers;
5456
#endif // !SILVERLIGHT && !AOT && !NETSTANDARD1_1 && !NETSTANDARD1_3
57+
#if SILVERLIGHT
58+
// For DateTime.ToBinary() extension method
59+
using MsgPack.Serialization.DefaultSerializers;
60+
#endif // SILVERLIGHT
5561
#if !MSTEST
5662
using NUnit.Framework;
5763
#else
@@ -947,7 +953,11 @@ public void TestDataMemberAttributeNamedProperties()
947953
[Test]
948954
public void TestEnum()
949955
{
956+
#if !SILVERLIGHT
950957
TestCore( DayOfWeek.Sunday, stream => ( DayOfWeek )Enum.Parse( typeof( DayOfWeek ), Unpacking.UnpackString( stream ) ), ( x, y ) => x == y );
958+
#else
959+
TestCore( DayOfWeek.Sunday, stream => ( DayOfWeek )Enum.Parse( typeof( DayOfWeek ), Unpacking.UnpackString( stream ), false ), ( x, y ) => x == y );
960+
#endif // !SILVERLIGHT
951961
}
952962

953963
#if !NETFX_CORE && !SILVERLIGHT
@@ -1476,6 +1486,8 @@ public void TestMultiDimensionalArrayComprex()
14761486
}
14771487
}
14781488

1489+
#if !SILVERLIGHT
1490+
14791491
[Test]
14801492
#if UNITY_WORKAROUND
14811493
[Ignore( "Unity's Array.SetValue is buggy for non-SZArray" )]
@@ -1548,6 +1560,8 @@ public void TestNonZeroBoundMultidimensionalArray()
15481560
}
15491561
}
15501562

1563+
#endif // !SILVERLIGHT
1564+
15511565

15521566
[Test]
15531567
public void TestHasInitOnlyFieldWithDefaultConstructor_Fail()
@@ -4195,7 +4209,8 @@ public void TestAbstractTypes_NotACollection_Fail()
41954209
Assert.Throws<NotSupportedException>( () => DoKnownCollectionTest<WithAbstractNonCollection>( context ) );
41964210
}
41974211

4198-
#if !NETFX_35 && !UNITY
4212+
#if !NETFX_35 && !UNITY && !SILVERLIGHT
4213+
41994214
[Test]
42004215
public void TestReadOnlyCollectionInterfaceDefault()
42014216
{
@@ -4277,7 +4292,8 @@ private static void TestCollectionInterfaceCore<T>( byte[] data, Action<T> asser
42774292
assertion( result );
42784293
}
42794294
}
4280-
#endif // !NETFX_35 && !UNITY
4295+
4296+
#endif // !NETFX_35 && !UNITY && !SILVERLIGHT
42814297

42824298
private void TestCore<T>( T value, Func<Stream, T> unpacking, Func<T, T, bool> comparer )
42834299
{
@@ -20378,6 +20394,7 @@ public void TestVersionFieldArrayNull()
2037820394
this.TestCoreWithAutoVerify( default( Version[] ), GetSerializationContext() );
2037920395
}
2038020396

20397+
#if !SILVERLIGHT
2038120398
[Test]
2038220399
public void TestFILETIMEField()
2038320400
{
@@ -20390,6 +20407,7 @@ public void TestFILETIMEFieldArray()
2039020407
this.TestCoreWithAutoVerify( Enumerable.Repeat( ToFileTime( DateTime.UtcNow ), 2 ).ToArray(), GetSerializationContext() );
2039120408
}
2039220409

20410+
#endif // !SILVERLIGHT
2039320411
[Test]
2039420412
public void TestTimeSpanField()
2039520413
{
@@ -21792,11 +21810,15 @@ private void TestCoreWithVerifiable<T>( T[] value, SerializationContext context
2179221810
}
2179321811
}
2179421812
}
21795-
21813+
21814+
#if !SILVERLIGHT
21815+
2179621816
private static FILETIME ToFileTime( DateTime dateTime )
2179721817
{
2179821818
var fileTime = dateTime.ToFileTimeUtc();
2179921819
return new FILETIME(){ dwHighDateTime = unchecked( ( int )( fileTime >> 32 ) ), dwLowDateTime = unchecked( ( int )( fileTime & 0xffffffff ) ) };
2180021820
}
21821+
21822+
#endif // !SILVERLIGHT
2180121823
}
2180221824
}

test/MsgPack.UnitTest.CodeDom/Serialization/MapCodeDomBasedAutoMessagePackSerializerTest.cs

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@
4141
using System.Numerics;
4242
#endif // !NETFX_35 && !WINDOWS_PHONE
4343
using System.Reflection;
44+
#if !SILVERLIGHT
4445
using System.Runtime.InteropServices.ComTypes;
46+
#endif // !SILVERLIGHT
4547
using System.Runtime.Serialization;
4648
using System.Text;
4749
using System.Text.RegularExpressions;
@@ -53,6 +55,10 @@
5355
using MsgPack.Serialization.CodeDomSerializers;
5456
using MsgPack.Serialization.EmittingSerializers;
5557
#endif // !SILVERLIGHT && !AOT && !NETSTANDARD1_1 && !NETSTANDARD1_3
58+
#if SILVERLIGHT
59+
// For DateTime.ToBinary() extension method
60+
using MsgPack.Serialization.DefaultSerializers;
61+
#endif // SILVERLIGHT
5662
#if !MSTEST
5763
using NUnit.Framework;
5864
#else
@@ -948,7 +954,11 @@ public void TestDataMemberAttributeNamedProperties()
948954
[Test]
949955
public void TestEnum()
950956
{
957+
#if !SILVERLIGHT
951958
TestCore( DayOfWeek.Sunday, stream => ( DayOfWeek )Enum.Parse( typeof( DayOfWeek ), Unpacking.UnpackString( stream ) ), ( x, y ) => x == y );
959+
#else
960+
TestCore( DayOfWeek.Sunday, stream => ( DayOfWeek )Enum.Parse( typeof( DayOfWeek ), Unpacking.UnpackString( stream ), false ), ( x, y ) => x == y );
961+
#endif // !SILVERLIGHT
952962
}
953963

954964
#if !NETFX_CORE && !SILVERLIGHT
@@ -1477,6 +1487,8 @@ public void TestMultiDimensionalArrayComprex()
14771487
}
14781488
}
14791489

1490+
#if !SILVERLIGHT
1491+
14801492
[Test]
14811493
#if UNITY_WORKAROUND
14821494
[Ignore( "Unity's Array.SetValue is buggy for non-SZArray" )]
@@ -1549,6 +1561,8 @@ public void TestNonZeroBoundMultidimensionalArray()
15491561
}
15501562
}
15511563

1564+
#endif // !SILVERLIGHT
1565+
15521566

15531567
[Test]
15541568
public void TestHasInitOnlyFieldWithDefaultConstructor_Fail()
@@ -4272,7 +4286,8 @@ public void TestAbstractTypes_NotACollection_Fail()
42724286
Assert.Throws<NotSupportedException>( () => DoKnownCollectionTest<WithAbstractNonCollection>( context ) );
42734287
}
42744288

4275-
#if !NETFX_35 && !UNITY
4289+
#if !NETFX_35 && !UNITY && !SILVERLIGHT
4290+
42764291
[Test]
42774292
public void TestReadOnlyCollectionInterfaceDefault()
42784293
{
@@ -4354,7 +4369,8 @@ private static void TestCollectionInterfaceCore<T>( byte[] data, Action<T> asser
43544369
assertion( result );
43554370
}
43564371
}
4357-
#endif // !NETFX_35 && !UNITY
4372+
4373+
#endif // !NETFX_35 && !UNITY && !SILVERLIGHT
43584374

43594375
private void TestCore<T>( T value, Func<Stream, T> unpacking, Func<T, T, bool> comparer )
43604376
{
@@ -20689,6 +20705,7 @@ public void TestVersionFieldArrayNull()
2068920705
this.TestCoreWithAutoVerify( default( Version[] ), GetSerializationContext() );
2069020706
}
2069120707

20708+
#if !SILVERLIGHT
2069220709
[Test]
2069320710
public void TestFILETIMEField()
2069420711
{
@@ -20701,6 +20718,7 @@ public void TestFILETIMEFieldArray()
2070120718
this.TestCoreWithAutoVerify( Enumerable.Repeat( ToFileTime( DateTime.UtcNow ), 2 ).ToArray(), GetSerializationContext() );
2070220719
}
2070320720

20721+
#endif // !SILVERLIGHT
2070420722
[Test]
2070520723
public void TestTimeSpanField()
2070620724
{
@@ -22103,11 +22121,15 @@ private void TestCoreWithVerifiable<T>( T[] value, SerializationContext context
2210322121
}
2210422122
}
2210522123
}
22106-
22124+
22125+
#if !SILVERLIGHT
22126+
2210722127
private static FILETIME ToFileTime( DateTime dateTime )
2210822128
{
2210922129
var fileTime = dateTime.ToFileTimeUtc();
2211022130
return new FILETIME(){ dwHighDateTime = unchecked( ( int )( fileTime >> 32 ) ), dwLowDateTime = unchecked( ( int )( fileTime & 0xffffffff ) ) };
2211122131
}
22132+
22133+
#endif // !SILVERLIGHT
2211222134
}
2211322135
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
x:Class="MsgPack.App"
4+
>
5+
<Application.Resources>
6+
7+
</Application.Resources>
8+
</Application>

0 commit comments

Comments
 (0)