Removed old tests. Refactored DeserializeAnonymousType method.
This commit is contained in:
@@ -549,7 +549,7 @@ keyword such as type of business.""
|
|||||||
|
|
||||||
JObject o = JObject.FromObject(new
|
JObject o = JObject.FromObject(new
|
||||||
{
|
{
|
||||||
channel = new
|
channel = new
|
||||||
{
|
{
|
||||||
title = "James Newton-King",
|
title = "James Newton-King",
|
||||||
link = "http://james.newtonking.com",
|
link = "http://james.newtonking.com",
|
||||||
|
|||||||
@@ -78,7 +78,6 @@
|
|||||||
<Compile Include="LinqToJsonTest.cs" />
|
<Compile Include="LinqToJsonTest.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="TestFixtureBase.cs" />
|
<Compile Include="TestFixtureBase.cs" />
|
||||||
<Compile Include="UtcDateTimeConverterTest.cs" />
|
|
||||||
<Compile Include="XmlNodeConverterTest.cs" />
|
<Compile Include="XmlNodeConverterTest.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
#region License
|
|
||||||
// Copyright (c) 2007 James Newton-King
|
|
||||||
//
|
|
||||||
// Permission is hereby granted, free of charge, to any person
|
|
||||||
// obtaining a copy of this software and associated documentation
|
|
||||||
// files (the "Software"), to deal in the Software without
|
|
||||||
// restriction, including without limitation the rights to use,
|
|
||||||
// copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
// copies of the Software, and to permit persons to whom the
|
|
||||||
// Software is furnished to do so, subject to the following
|
|
||||||
// conditions:
|
|
||||||
//
|
|
||||||
// The above copyright notice and this permission notice shall be
|
|
||||||
// included in all copies or substantial portions of the Software.
|
|
||||||
//
|
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
||||||
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
||||||
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
||||||
// OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using NUnit.Framework;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.IO;
|
|
||||||
using Newtonsoft.Json.Converters;
|
|
||||||
using System.Xml;
|
|
||||||
using System.Globalization;
|
|
||||||
|
|
||||||
namespace Newtonsoft.Json.Tests
|
|
||||||
{
|
|
||||||
public class IsoDateTimeConverterTest : TestFixtureBase
|
|
||||||
{
|
|
||||||
[Test]
|
|
||||||
public void ShouldBeAbleToConvertDateTimes()
|
|
||||||
{
|
|
||||||
IsoDateTimeConverter conv = new IsoDateTimeConverter();
|
|
||||||
Assert.IsTrue(conv.CanConvert(typeof(DateTime)));
|
|
||||||
Assert.IsTrue(conv.CanConvert(typeof(DateTimeOffset)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -460,7 +460,7 @@ namespace Newtonsoft.Json
|
|||||||
/// <returns>The deserialized anonymous type from the JSON string.</returns>
|
/// <returns>The deserialized anonymous type from the JSON string.</returns>
|
||||||
public static T DeserializeAnonymousType<T>(string value, T anonymousTypeObject)
|
public static T DeserializeAnonymousType<T>(string value, T anonymousTypeObject)
|
||||||
{
|
{
|
||||||
return (T)DeserializeObject(value, typeof(T));
|
return DeserializeObject<T>(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user