-Fixed build

This commit is contained in:
James Newton-King
2014-04-26 23:06:30 +12:00
parent b40d705644
commit 11c2ad5c1c
15 changed files with 112 additions and 18 deletions
@@ -28,7 +28,13 @@ using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Tests.TestObjects;
#if !NETFX_CORE
using NUnit.Framework;
#else
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute;
using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute;
#endif
namespace Newtonsoft.Json.Tests.Serialization
{
@@ -40,7 +40,13 @@ 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.TestPlatform.UnitTestFramework;
using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute;
using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute;
#endif
namespace Newtonsoft.Json.Tests.Serialization
{
@@ -228,7 +228,7 @@ namespace Newtonsoft.Json.Tests.Serialization
var json = JsonConvert.SerializeObject(input);
var deserialized = JsonConvert.DeserializeObject<ResponseWithNewGenericProperty<List<int>>>(json);
Assert.AreEqual(input.Data, deserialized.Data);
CollectionAssert.AreEqual(input.Data, deserialized.Data);
Assert.AreEqual(input.Message, deserialized.Message);
Assert.AreEqual(input.Result, deserialized.Result);
}
@@ -651,6 +651,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual("value", deserialized.foo.bar);
}
#if !NETFX_CORE
[Test]
public void ConversionOperator()
{
@@ -676,6 +677,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Console.WriteLine("Time elapsed: " + stopWatch.ElapsedMilliseconds);
}
#endif
internal class DictionaryKeyCast
{
@@ -29,7 +29,13 @@ using System.Globalization;
using System.IO;
using System.Text;
using Newtonsoft.Json.Serialization;
#if !NETFX_CORE
using NUnit.Framework;
#else
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute;
using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute;
#endif
namespace Newtonsoft.Json.Tests.Serialization
{
@@ -93,9 +99,9 @@ namespace Newtonsoft.Json.Tests.Serialization
var deserializedSetFoo = JsonConvert.DeserializeObject<Foo1>(setFooJson);
Assert.AreEqual(setFoo.name, deserializedSetFoo.name);
Assert.NotNull(deserializedSetFoo.myBar);
Assert.IsNotNull(deserializedSetFoo.myBar);
Assert.AreEqual(setFoo.myBar.name, deserializedSetFoo.myBar.name);
Assert.NotNull(deserializedSetFoo.myBar.myBaz);
Assert.IsNotNull(deserializedSetFoo.myBar.myBaz);
Assert.AreEqual(setFoo.myBar.myBaz.Length, deserializedSetFoo.myBar.myBaz.Length);
Assert.AreEqual(setFoo.myBar.myBaz[0].name, deserializedSetFoo.myBar.myBaz[0].name);
Assert.IsNotNull(deserializedSetFoo.myBar.myBaz[0].myFrob[0]);
@@ -125,7 +131,7 @@ namespace Newtonsoft.Json.Tests.Serialization
jsonSerializer.Serialize(jsonWriter, f, typeof(Foo1));
}
Console.Out.WriteLine("Trace output:\n{0}", traceWriter.ToString());
Console.WriteLine("Trace output:\n{0}", traceWriter.ToString());
return sw.ToString();
}
@@ -1,11 +1,42 @@
using System;
#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.Runtime.Serialization.Formatters;
using System.Text;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Tests.TestObjects;
using Newtonsoft.Json.Utilities;
#if !NETFX_CORE
using NUnit.Framework;
#else
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute;
using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute;
#endif
namespace Newtonsoft.Json.Tests.Serialization
{
@@ -1765,7 +1765,7 @@ namespace Newtonsoft.Json.Tests.Serialization
});
ReportItemKeys item = (ReportItemKeys)g.ItemIdentifier;
Assert.AreEqual(1, item.WantedUnitID);
Assert.AreEqual(1UL, item.WantedUnitID);
}
#endif
}