ExpandoObject Explained In Tests (Except For One Mystery)
Posted by: K. Scott Allen,
on 08 Nov 2010 |
View original | Bookmarked: 0 time(s)
The following tests all pass for .NET 4.0s ExpandoObject. private dynamic expando = new ExpandoObject();
[Test]
public void Can_Add_A_Member()
{
var expected = "Scott";
expando.Name = expected;
Assert.AreEqual(expected, expando.Name);
}
[Test]
public void But_Cannot_Reflect_It()
{
expando.Name = "Scott";
Assert.IsNull(expando.GetType().GetProperty("Name"));
}
[Test]
public void Is_A_Dictionary()
{
var expected = "Scott";
var dictionary...