-Fix deserializing empty BSON structures

-Fix error message when attempting to deserialize custom dictionary with no default constructor
-Fix serializing private base members marked with JsonProperty attribute
-Fix performance issue when deserializing to object member
This commit is contained in:
JamesNK
2010-01-16 06:10:10 +00:00
parent 75649bfa00
commit f9b34390f5
7 changed files with 232 additions and 28 deletions
@@ -647,5 +647,29 @@ bye", reader.Value);
Assert.IsFalse(jsonReader.Read());
}
[Test]
public void ReadUnicode()
{
string json = @"{""Message"":""Hi,I\u0092ve send you smth""}";
JsonTextReader reader = new JsonTextReader(new StringReader(json));
Assert.IsTrue(reader.Read());
Assert.AreEqual(JsonToken.StartObject, reader.TokenType);
Assert.IsTrue(reader.Read());
Assert.AreEqual(JsonToken.PropertyName, reader.TokenType);
Assert.AreEqual("Message", reader.Value);
Assert.IsTrue(reader.Read());
Assert.AreEqual(JsonToken.String, reader.TokenType);
Assert.AreEqual(@"Hi,I" + '\u0092' + "ve send you smth", reader.Value);
Assert.IsTrue(reader.Read());
Assert.AreEqual(JsonToken.EndObject, reader.TokenType);
Assert.IsFalse(reader.Read());
}
}
}