Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/Newtonsoft.Json.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Newtonsoft.Json.Tests/Linq/JObjectTests.cs')
-rw-r--r--Src/Newtonsoft.Json.Tests/Linq/JObjectTests.cs23
1 files changed, 19 insertions, 4 deletions
diff --git a/Src/Newtonsoft.Json.Tests/Linq/JObjectTests.cs b/Src/Newtonsoft.Json.Tests/Linq/JObjectTests.cs
index 5790feb..9e8c69a 100644
--- a/Src/Newtonsoft.Json.Tests/Linq/JObjectTests.cs
+++ b/Src/Newtonsoft.Json.Tests/Linq/JObjectTests.cs
@@ -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,13 +11,16 @@ 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
{
@@ -26,6 +28,19 @@ namespace Newtonsoft.Json.Tests.Linq
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()
{
JObject o = new JObject();