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:
authorJames Newton-King <james@newtonking.com>2012-03-15 09:34:51 +0400
committerJames Newton-King <james@newtonking.com>2012-03-15 09:34:51 +0400
commit5800e97ff36d3dacea20ec75e80ebfa5f76100cd (patch)
tree25efafe5c48e846797bd9a4119ab2b130d686b8b /Src/Newtonsoft.Json.Tests/Serialization/PreserveReferencesHandlingTests.cs
parentf9e5745425f3d4e7ca4da340f583a45c7d495660 (diff)
-Added Newtonsoft.Json.Metro build (whew, what a pain!)
-Added .gitignore file
Diffstat (limited to 'Src/Newtonsoft.Json.Tests/Serialization/PreserveReferencesHandlingTests.cs')
-rw-r--r--Src/Newtonsoft.Json.Tests/Serialization/PreserveReferencesHandlingTests.cs20
1 files changed, 17 insertions, 3 deletions
diff --git a/Src/Newtonsoft.Json.Tests/Serialization/PreserveReferencesHandlingTests.cs b/Src/Newtonsoft.Json.Tests/Serialization/PreserveReferencesHandlingTests.cs
index 40f5251..e6012bf 100644
--- a/Src/Newtonsoft.Json.Tests/Serialization/PreserveReferencesHandlingTests.cs
+++ b/Src/Newtonsoft.Json.Tests/Serialization/PreserveReferencesHandlingTests.cs
@@ -30,10 +30,17 @@ using System.Linq;
using System.Text;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Tests.TestObjects;
+#if !NETFX_CORE
using NUnit.Framework;
+#else
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using TestFixture = Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute;
+using Test = Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute;
+#endif
namespace Newtonsoft.Json.Tests.Serialization
{
+ [TestFixture]
public class PreserveReferencesHandlingTests : TestFixtureBase
{
[Test]
@@ -133,7 +140,6 @@ namespace Newtonsoft.Json.Tests.Serialization
string json = JsonConvert.SerializeObject(circularList, Formatting.Indented,
new JsonSerializerSettings { PreserveReferencesHandling = PreserveReferencesHandling.All });
- WriteEscapedJson(json);
Assert.AreEqual(@"{
""$id"": ""1"",
""$values"": [
@@ -202,7 +208,11 @@ namespace Newtonsoft.Json.Tests.Serialization
}
[Test]
- [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = @"Cannot preserve reference to array or readonly list: System.String[][]. Line 3, position 15.")]
+ [ExpectedException(typeof(JsonSerializationException)
+#if !NETFX_CORE
+ , ExpectedMessage = @"Cannot preserve reference to array or readonly list: System.String[][]. Line 3, position 15."
+#endif
+ )]
public void DeserializeArraysWithPreserveObjectReferences()
{
string json = @"{
@@ -268,7 +278,11 @@ namespace Newtonsoft.Json.Tests.Serialization
}
[Test]
- [ExpectedException(typeof(JsonSerializationException), ExpectedMessage = @"Unexpected end when deserializing object. Line 2, position 9.")]
+ [ExpectedException(typeof(JsonSerializationException)
+#if !NETFX_CORE
+ , ExpectedMessage = @"Unexpected end when deserializing object. Line 2, position 9."
+#endif
+ )]
public void UnexpectedEnd()
{
string json = @"{