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

Dont call .Satisfies() condition when .When() returns false #165

Closed
aletc1 opened this issue Aug 9, 2018 · 1 comment
Closed

Dont call .Satisfies() condition when .When() returns false #165

aletc1 opened this issue Aug 9, 2018 · 1 comment
Assignees

Comments

@aletc1
Copy link

aletc1 commented Aug 9, 2018

In this code snippet:

.Ensure(m => m.Prop, o => o                   
   .Satisfies(prop => condition1)
   .When(x => condition2)

In the current version, condition1 and condition2 gets evaluated. But wouldnt be better to not evaluate condition1 if condition2 fails (returns false)?

Expected result: condition1 doesnt get evaluated if condition2 evaluates to false

Thank you

@GooRiOn GooRiOn self-assigned this Aug 10, 2018
@GooRiOn
Copy link
Member

GooRiOn commented Aug 10, 2018

Good point! I'll look at that.

@GooRiOn GooRiOn mentioned this issue Oct 7, 2018
@GooRiOn GooRiOn closed this as completed Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants