Permalink
Browse files

Merge pull request #63 from emiaj/indexer_test

Indexer test
  • Loading branch information...
2 parents c635657 + a163310 commit dfa701bed7febeca0780c368cd944f5daddcb557 @jeremydmiller jeremydmiller committed Feb 20, 2013
@@ -320,9 +320,10 @@ public void get_value_by_indexer_when_the_indexer_is_variable_reference_of_a_com
public void get_owner_type_by_indexer()
{
var accessor = ReflectionHelper.GetAccessor<Target>(x => x.Child.Grandchildren[1].Deep.Color);
- accessor.OwnerType.ShouldEqual(typeof (DeepTarget));
+ accessor.OwnerType.ShouldEqual(typeof(DeepTarget));
ReflectionHelper.GetAccessor<Target>(x => x.Child.Grandchildren[1]).OwnerType.ShouldEqual(typeof(ChildTarget));
+ ReflectionHelper.GetAccessor<Target>(x => x.Child.Grandchildren[1].Name).OwnerType.ShouldEqual(typeof(GrandChildTarget));
}
[Test]
@@ -67,7 +67,8 @@ public Type OwnerType
}
var propertyGetter = _chain.Last() as PropertyValueGetter;
- return propertyGetter != null ? propertyGetter.PropertyInfo.PropertyType : null;
+ if (propertyGetter != null) return propertyGetter.PropertyInfo.PropertyType;
+ return InnerProperty != null ? InnerProperty.DeclaringType : null;
}
}

0 comments on commit dfa701b

Please sign in to comment.