Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gracefully handle unset properties #1

Closed
becdetat opened this issue Feb 12, 2015 · 0 comments
Closed

gracefully handle unset properties #1

becdetat opened this issue Feb 12, 2015 · 0 comments

Comments

@becdetat
Copy link
Owner

Checkk.CheckGenericInvarian.FieldName should handle properties. Target.Body seems to be a member expression if set but a propertyExpression if not set:

class Person { public string Name{get;set;}}
var person1 = new Person { Name = "foo" };
Check.That(() => person1.Name).IsNotNullOrEmpty(); // works
var person2 = new Person();
Check.That(() => person2.Name).IsNotNullOrEmpty(); // throws an argument exception in CheckGenericInvariant.FieldName
@becdetat becdetat changed the title gracefully handle properties that are methods gracefully handle unset properties Jul 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant