-Added IgnoreSerializableInterface to DefaultContractResolver
-Changed serializing ISerializable types under partial trust to error to fix security issue -Fixed LinqBridge collision error in .NET 2.0 by moving types to a different namespace -Fixed JObject.Keys error when object has no items
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json.Tests.TestObjects;
|
||||
#if !NETFX_CORE
|
||||
using NUnit.Framework;
|
||||
@@ -12,19 +11,35 @@ using TestFixture = Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttrib
|
||||
using Test = Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute;
|
||||
#endif
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
#if !PocketPC && !SILVERLIGHT && !NETFX_CORE
|
||||
using System.Web.UI;
|
||||
#endif
|
||||
#if NET20
|
||||
using Newtonsoft.Json.Utilities.LinqBridge;
|
||||
#else
|
||||
using System.Linq;
|
||||
#endif
|
||||
|
||||
namespace Newtonsoft.Json.Tests.Linq
|
||||
{
|
||||
[TestFixture]
|
||||
public class JObjectTests : TestFixtureBase
|
||||
{
|
||||
[Test]
|
||||
public void Keys()
|
||||
{
|
||||
var o = new JObject();
|
||||
var d = (IDictionary<string, JToken>) o;
|
||||
|
||||
Assert.AreEqual(0, d.Keys.Count);
|
||||
|
||||
o["value"] = true;
|
||||
|
||||
Assert.AreEqual(1, d.Keys.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TryGetValue()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user