Removed old tests. Refactored DeserializeAnonymousType method.

This commit is contained in:
JamesNK
2008-03-02 06:57:47 +00:00
parent abd8da25a7
commit e2203d8f63
4 changed files with 2 additions and 51 deletions
+1 -1
View File
@@ -549,7 +549,7 @@ keyword such as type of business.""
JObject o = JObject.FromObject(new
{
channel = new
channel = new
{
title = "James Newton-King",
link = "http://james.newtonking.com",
@@ -78,7 +78,6 @@
<Compile Include="LinqToJsonTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestFixtureBase.cs" />
<Compile Include="UtcDateTimeConverterTest.cs" />
<Compile Include="XmlNodeConverterTest.cs" />
</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)));
}
}
}
+1 -1
View File
@@ -460,7 +460,7 @@ namespace Newtonsoft.Json
/// <returns>The deserialized anonymous type from the JSON string.</returns>
public static T DeserializeAnonymousType<T>(string value, T anonymousTypeObject)
{
return (T)DeserializeObject(value, typeof(T));
return DeserializeObject<T>(value);
}
/// <summary>