-Fix bug when JValue of type string has a null string value

-Fix JToken casting bugs to float and decimal
This commit is contained in:
JamesNK
2009-04-30 10:12:42 +00:00
parent 52f8657106
commit a0a8599d3d
4 changed files with 30 additions and 8 deletions
@@ -410,5 +410,23 @@ Parameter name: arrayIndex")]
i++;
}
}
[Test]
public void WriteObjectNullStringValue()
{
string s = null;
JValue v = new JValue(s);
Assert.AreEqual(null, v.Value);
Assert.AreEqual(JTokenType.String, v.Type);
JObject o = new JObject();
o["title"] = v;
string output = o.ToString();
Assert.AreEqual(@"{
""title"": null
}", output);
}
}
}