-Upgraded Silverlight project to Silverlight 4

-Included .NET 4 features in Silverlight project
This commit is contained in:
JamesNK
2011-01-03 05:19:57 +00:00
parent 1aa3ff31a1
commit a96f4d4248
18 changed files with 134 additions and 51 deletions
@@ -1,4 +1,4 @@
#if !(NET35 || NET20 || SILVERLIGHT)
#if !(NET35 || NET20)
using System;
using System.Collections;
using System.Collections.Generic;
@@ -147,15 +147,17 @@ namespace Newtonsoft.Json.Tests.Serialization
string json = JsonConvert.SerializeObject(o, Formatting.Indented, new JsonSerializerSettings
{
TypeNameHandling = TypeNameHandling.All
TypeNameHandling = TypeNameHandling.All,
TypeNameAssemblyFormat = FormatterAssemblyStyle.Full
});
Console.WriteLine(json);
string dynamicChildObjectTypeName = ReflectionUtils.GetTypeName(typeof(DynamicChildObject), FormatterAssemblyStyle.Simple);
string dynamicChildObjectTypeName = ReflectionUtils.GetTypeName(typeof(DynamicChildObject), FormatterAssemblyStyle.Full);
string expandoObjectTypeName = ReflectionUtils.GetTypeName(typeof(ExpandoObject), FormatterAssemblyStyle.Full);
Assert.AreEqual(@"{
""$type"": ""System.Dynamic.ExpandoObject, System.Core"",
""$type"": """ + expandoObjectTypeName + @""",
""Text"": ""Text!"",
""Integer"": 2147483647,
""DynamicChildObject"": {
@@ -167,7 +169,8 @@ namespace Newtonsoft.Json.Tests.Serialization
dynamic n = JsonConvert.DeserializeObject(json, null, new JsonSerializerSettings
{
TypeNameHandling = TypeNameHandling.All
TypeNameHandling = TypeNameHandling.All,
TypeNameAssemblyFormat = FormatterAssemblyStyle.Full
});
Assert.IsInstanceOfType(typeof(ExpandoObject), n);
@@ -55,7 +55,7 @@ using System.Text.RegularExpressions;
using System.Collections.Specialized;
using System.Linq.Expressions;
#endif
#if !(NET35 || NET20 || SILVERLIGHT)
#if !(NET35 || NET20 || WINDOWS_PHONE)
using System.Dynamic;
#endif
@@ -3753,7 +3753,7 @@ keyword such as type of business.""
}", json);
}
#if !(NET35 || NET20 || SILVERLIGHT)
#if !(NET35 || NET20 || WINDOWS_PHONE)
[Test]
public void SerializeExpandoObject()
{
@@ -195,7 +195,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual(new DateTime(2000, 12, 1, 0, 0, 0, DateTimeKind.Utc), c[2]);
Assert.AreEqual(3, errors.Count);
#if !(NET20 || NET35 || SILVERLIGHT)
#if !(NET20 || NET35 || WINDOWS_PHONE)
Assert.AreEqual("The string was not recognized as a valid DateTime. There is an unknown word starting at index 0.", errors[0]);
#else
Assert.AreEqual("The string was not recognized as a valid DateTime. There is a unknown word starting at index 0.", errors[0]);