-Refactored parsing dates

-Refactored writing integers
-Refactored JsonConvert
This commit is contained in:
James Newton-King
2013-04-21 18:27:08 +12:00
parent 2b357700f0
commit b6d3168ed8
41 changed files with 1335 additions and 572 deletions
@@ -50,6 +50,7 @@ using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq;
#endif
using Newtonsoft.Json.Utilities;
namespace Newtonsoft.Json.Tests.Linq
{
@@ -419,7 +420,7 @@ Parameter name: arrayIndex",
JArray a = (JArray)JsonConvert.DeserializeObject(json);
JValue v = (JValue)a[0];
Assert.AreEqual(JsonConvert.ConvertJavaScriptTicksToDateTime(1207285200000), (DateTime)v);
Assert.AreEqual(DateTimeUtils.ConvertJavaScriptTicksToDateTime(1207285200000), (DateTime)v);
}
[Test]
@@ -43,6 +43,7 @@ using System.IO;
using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq;
using Newtonsoft.Json.Utilities;
#endif
namespace Newtonsoft.Json.Tests.Linq
@@ -90,7 +91,7 @@ namespace Newtonsoft.Json.Tests.Linq
DateParseHandling = DateParseHandling.DateTimeOffset
});
Assert.AreEqual(typeof(DateTimeOffset), v.Value.GetType());
Assert.AreEqual(new DateTimeOffset(JsonConvert.InitialJavaScriptDateTicks, new TimeSpan(12, 31, 0)), v.Value);
Assert.AreEqual(new DateTimeOffset(DateTimeUtils.InitialJavaScriptDateTicks, new TimeSpan(12, 31, 0)), v.Value);
#endif
}