Fix issue with Binder on objects with indexers #272
Conversation
{ | ||
var builder = new ConfigurationBuilder(); | ||
var config = builder.Build(); | ||
var options = ConfigurationBinder.Bind<List<string>>(config); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any asserts for this test. We should be verifying something right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This used to throw before the fix, so I don't typically use Assert.NotThrow... but that's basically what it this test is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assert.NotNull
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure that's fine
@@ -157,6 +157,14 @@ public void ConsistentExceptionOnFailedBinding(Type type) | |||
} | |||
|
|||
[Fact] | |||
public void BinderDoesNotChokeOnIndexer() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choke
--> Throw
please 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or better, BinderIgnoresIndexerProperties
.
But other than that, yeah, |
Fixes #253
cc @kirthik @divega