-Fixed build

This commit is contained in:
James Newton-King
2012-11-19 10:52:46 +13:00
parent a8249e38df
commit ed1b7c2f2d
5 changed files with 24 additions and 23 deletions
+20 -20
View File
@@ -290,28 +290,28 @@ namespace Newtonsoft.Json.Tests.Linq
[Test] [Test]
public void ToObject() public void ToObject()
{ {
Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(ushort)))); Assert.AreEqual((ushort)1, (new JValue(1).ToObject(typeof(ushort))));
Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(ushort?)))); Assert.AreEqual((ushort)1, (new JValue(1).ToObject(typeof(ushort?))));
Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(uint)))); Assert.AreEqual((uint)1L, (new JValue(1).ToObject(typeof(uint))));
Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(uint?)))); Assert.AreEqual((uint)1L, (new JValue(1).ToObject(typeof(uint?))));
Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(ulong)))); Assert.AreEqual((ulong)1L, (new JValue(1).ToObject(typeof(ulong))));
Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(ulong?)))); Assert.AreEqual((ulong)1L, (new JValue(1).ToObject(typeof(ulong?))));
Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(sbyte)))); Assert.AreEqual((sbyte)1L, (new JValue(1).ToObject(typeof(sbyte))));
Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(sbyte?)))); Assert.AreEqual((sbyte)1L, (new JValue(1).ToObject(typeof(sbyte?))));
Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(byte)))); Assert.AreEqual((byte)1L, (new JValue(1).ToObject(typeof(byte))));
Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(byte?)))); Assert.AreEqual((byte)1L, (new JValue(1).ToObject(typeof(byte?))));
Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(short)))); Assert.AreEqual((short)1L, (new JValue(1).ToObject(typeof(short))));
Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(short?)))); Assert.AreEqual((short)1L, (new JValue(1).ToObject(typeof(short?))));
Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(int)))); Assert.AreEqual(1, (new JValue(1).ToObject(typeof(int))));
Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(int?)))); Assert.AreEqual(1, (new JValue(1).ToObject(typeof(int?))));
Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(long)))); Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(long))));
Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(long?)))); Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(long?))));
Assert.AreEqual(1L, (new JValue(1.0).ToObject(typeof(float)))); Assert.AreEqual((float)1, (new JValue(1.0).ToObject(typeof(float))));
Assert.AreEqual(1L, (new JValue(1.0).ToObject(typeof(float?)))); Assert.AreEqual((float)1, (new JValue(1.0).ToObject(typeof(float?))));
Assert.AreEqual(1L, (new JValue(1.0).ToObject(typeof(double)))); Assert.AreEqual((double)1, (new JValue(1.0).ToObject(typeof(double))));
Assert.AreEqual(1L, (new JValue(1.0).ToObject(typeof(double?)))); Assert.AreEqual((double)1, (new JValue(1.0).ToObject(typeof(double?))));
Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(decimal)))); Assert.AreEqual(1m, (new JValue(1).ToObject(typeof(decimal))));
Assert.AreEqual(1L, (new JValue(1).ToObject(typeof(decimal?)))); Assert.AreEqual(1m, (new JValue(1).ToObject(typeof(decimal?))));
Assert.AreEqual(true, (new JValue(true).ToObject(typeof(bool)))); Assert.AreEqual(true, (new JValue(true).ToObject(typeof(bool))));
Assert.AreEqual(true, (new JValue(true).ToObject(typeof(bool?)))); Assert.AreEqual(true, (new JValue(true).ToObject(typeof(bool?))));
Assert.AreEqual('b', (new JValue('b').ToObject(typeof(char)))); Assert.AreEqual('b', (new JValue('b').ToObject(typeof(char))));
@@ -76,5 +76,5 @@ using System.Security;
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("4.5.0.0")] [assembly: AssemblyVersion("4.5.0.0")]
#if !PocketPC #if !PocketPC
[assembly: AssemblyFileVersion("4.5.10.15518")] [assembly: AssemblyFileVersion("4.5.10.15519")]
#endif #endif
@@ -149,7 +149,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}", json); }", json);
} }
#if !(PORTABLE || SILVERLIGHT) #if !(PORTABLE || SILVERLIGHT || NETFX_CORE)
public class MainClass : ISerializable public class MainClass : ISerializable
{ {
public ChildClass Child { get; set; } public ChildClass Child { get; set; }
@@ -244,6 +244,7 @@
<Compile Include="Serialization\DiagnosticsTraceWriter.cs" /> <Compile Include="Serialization\DiagnosticsTraceWriter.cs" />
<Compile Include="Serialization\MemoryTraceWriter.cs" /> <Compile Include="Serialization\MemoryTraceWriter.cs" />
<Compile Include="StreamingContext.cs" /> <Compile Include="StreamingContext.cs" />
<Compile Include="StringEscapeHandling.cs" />
<Compile Include="TraceLevel.cs" /> <Compile Include="TraceLevel.cs" />
<Compile Include="TypeNameHandling.cs" /> <Compile Include="TypeNameHandling.cs" />
<Compile Include="Utilities\Base64Encoder.cs" /> <Compile Include="Utilities\Base64Encoder.cs" />
@@ -90,7 +90,7 @@ using System.Security;
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("4.5.0.0")] [assembly: AssemblyVersion("4.5.0.0")]
#if !PocketPC #if !PocketPC
[assembly: AssemblyFileVersion("4.5.10.15518")] [assembly: AssemblyFileVersion("4.5.10.15519")]
#endif #endif
[assembly: CLSCompliant(true)] [assembly: CLSCompliant(true)]