-Fixed duplicate type name within an assembly error

This commit is contained in:
JamesNK
2011-02-24 01:46:00 +00:00
parent 05a4395a94
commit 1824aa4b59
4 changed files with 62 additions and 11 deletions
@@ -4154,5 +4154,29 @@ keyword such as type of business.""
Assert.AreEqual("Two", c2.Enumerable.ElementAt(1));
Assert.AreEqual("Three", c2.Enumerable.ElementAt(2));
}
[JsonObject(MemberSerialization.OptIn)]
public class ItemBase
{
[JsonProperty]
public string Name { get; set; }
}
public class ComplexItem : ItemBase
{
public Stream Source { get; set; }
}
[Test]
public void SerializeAttributesOnBase()
{
ComplexItem i = new ComplexItem();
string json = JsonConvert.SerializeObject(i, Formatting.Indented);
Assert.AreEqual(@"{
""Name"": null
}", json);
}
}
}