Work in progress:

-Silverlight build projects
-JObject now implements IDictionary, JArray now implements IList
This commit is contained in:
JamesNK
2008-06-08 10:41:20 +00:00
parent 03fb558bb9
commit 0ae1c636bd
33 changed files with 943 additions and 157 deletions
@@ -23,6 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !SILVERLIGHT
using System;
using NUnit.Framework;
using Newtonsoft.Json;
@@ -455,4 +456,5 @@ namespace Newtonsoft.Json.Tests.Converters
XmlDocument newDoc = (XmlDocument)JavaScriptConvert.DeserializeXmlNode(strJSON);
}
}
}
}
#endif
@@ -96,7 +96,7 @@ now brown cow?", '"', true);
[ExpectedException(typeof(ArgumentException), ExpectedMessage = "Unsupported type: System.Version. Use the JsonSerializer class to get the object's JSON representation.")]
public void ToStringInvalid()
{
JavaScriptConvert.ToString(new Version());
JavaScriptConvert.ToString(new Version(1, 0));
}
[Test]
@@ -33,12 +33,10 @@ using System.Collections;
using System.Xml;
using System.Xml.Serialization;
using System.Collections.ObjectModel;
using System.Runtime.Serialization.Json;
using System.Net.Mail;
using System.Web.Script.Serialization;
using Newtonsoft.Json.Linq;
using System.Linq;
using Newtonsoft.Json.Converters;
using System.Runtime.Serialization.Json;
namespace Newtonsoft.Json.Tests
{
@@ -216,6 +214,8 @@ namespace Newtonsoft.Json.Tests
Store deserializedStore = (Store)JavaScriptConvert.DeserializeObject(jsonText, typeof(Store));
Assert.AreEqual(store.Establised, deserializedStore.Establised);
Console.WriteLine(jsonText);
}
@@ -327,6 +327,7 @@ namespace Newtonsoft.Json.Tests
Assert.AreEqual(executorObject2.clientGetResultFunction, "ClientBanSubsCB");
}
#if !SILVERLIGHT
[Test]
public void HashtableDeserialization()
{
@@ -355,6 +356,7 @@ namespace Newtonsoft.Json.Tests
""01/24/2010 12:00:00""
]", p.Hash["UntypedArray"].ToString());
}
#endif
public class GetOnlyPropertyClass
{
@@ -969,7 +971,7 @@ keyword such as type of business.""
[Test]
public void SerializeStack()
{
Stack s = new Stack();
Stack<object> s = new Stack<object>();
s.Push(1);
s.Push(2);
s.Push(3);
@@ -29,7 +29,6 @@ using System.Text;
using NUnit.Framework;
using Newtonsoft.Json;
using System.IO;
using System.Runtime.Serialization.Json;
namespace Newtonsoft.Json.Tests
{
@@ -29,7 +29,6 @@ using System.Linq;
using System.Text;
using NUnit.Framework;
using Newtonsoft.Json.Linq;
using System.Xml.Linq;
namespace Newtonsoft.Json.Tests.Linq
{
@@ -64,9 +63,6 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual(v, o["Test1"]);
XText t = new XText("XText");
Assert.AreEqual(null, t.Parent);
Assert.AreEqual(null, o.Parent);
JProperty o1 = new JProperty("O1", o);
Assert.AreEqual(o, o1.Value);
@@ -447,7 +447,7 @@ keyword such as type of business.""
//}
var postTitles =
from p in rss["channel"]["item"].Children()
from p in rss["channel"]["item"]
select p.Value<string>("title");
foreach (var item in postTitles)
+5 -5
View File
@@ -34,11 +34,11 @@ namespace Newtonsoft.Json.Tests
[TestFixture]
public abstract class TestFixtureBase
{
public string GetOffset(DateTime value)
{
TimeSpan utcOffset = TimeZone.CurrentTimeZone.GetUtcOffset(value.ToLocalTime());
//public string GetOffset(DateTime value)
//{
// TimeSpan utcOffset = TimeZone.CurrentTimeZone.GetUtcOffset(value.ToLocalTime());
return utcOffset.Hours.ToString("+00;-00") + utcOffset.Minutes.ToString("00;00");
}
// return utcOffset.Hours.ToString("+00;-00") + utcOffset.Minutes.ToString("00;00");
//}
}
}