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

Fix for the #409 #411

Merged
merged 1 commit into from
Jul 11, 2017
Merged

Fix for the #409 #411

merged 1 commit into from
Jul 11, 2017

Conversation

vladonemo
Copy link
Contributor

Ok, trying again. I hope that this PR is now OK - there are only 2 files changed.

The fix for #409 is to revert the order of the items of the invocations list in he FluentMockContext before disposing the items. The new test runs into a situation, that there are at least 2 MockInvocations created on the mock which is constructed with DefaultValue.Empty. The first one remembers the original DefalutValue (Empty) and sets it to Mock. The second one remembers the current value of DefaultValue (Mock) and sets it to the Mock, too. Now, if the MockInvocations are disposed in the same order as they were created, the first MockInvocation will set the DefaultValue of the mock back to the value it remembered - Empty. Then the second MockInvocation is disposed and sets the DefaultValue to the Mock, as this is the one that it remembered. By reverting the disposal order we make sure that the DefaultValue is reverted back to the original value before the first MockInvocation was constructed.

@vladonemo vladonemo mentioned this pull request Jul 11, 2017
@stakx
Copy link
Contributor

stakx commented Jul 11, 2017

Thanks for cleaning this up, this looks much better! 👍 I'll look at this in detail later today.

@stakx stakx merged commit 2383397 into devlooped:develop Jul 11, 2017
@stakx
Copy link
Contributor

stakx commented Jul 11, 2017

Thank you for the fix!

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

Successfully merging this pull request may close these issues.

None yet

2 participants