RickStrahl / Expando

Extensible dynamic types for .NET
108 stars 30 forks source link

Concrete property and indexer return not same value #3

Closed dkuida closed 8 years ago

dkuida commented 8 years ago

In the case of existing property - access through property or through index should return the same value, but actually an indexer is stored in Properties and not in Object

   public class ObjWithProp : Expando
{
    public string SomeProp { get; set; }
}

[TestFixture]
[Ignore]
public class ExistingProps
{

    [Test]
    public void Given_Porp_When_SetWithIndex_Then_PropsValue()
    {
        //arrange
        ObjWithProp obj = new ObjWithProp();
        //act
        obj.SomeProp = "value1";
        obj["SomeProp"] = "value2";
        //assert
        Assert.AreEqual("value2",obj.SomeProp);

    }
}
RickStrahl commented 8 years ago

Duplicate.