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

#825 event handlers setup and verify #857

Merged
merged 6 commits into from
Jul 24, 2019

Conversation

lepijohnny
Copy link
Contributor

Hi,

I was busy during the weekend with this feature, it adds the functionality to Setup and Verify events as all other methods. I tried to preserve backward compatibility and also I have added new test scenarios to verify this feature. Four new methods have been added (I am maybe thinking of merging this to SetupEvent and VerifyEvent):
SetupAdd
SetupRemove
VerifyAdd
VerifyRemove

Besides these methods Verify(), VerifyAll() and VerifyNoOtherCalls work as well.

Kind regards,
Nikola

@stakx
Copy link
Contributor

stakx commented Jul 10, 2019

Thanks for the PR, @lepijohnny. I'll try to review sometime during the next few days.

@lepijohnny
Copy link
Contributor Author

np, take your time. I will add few more comments to PR since I noticed some issues but didn't really have time to fix PR.

Copy link
Contributor

@stakx stakx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! I'm getting the impression that you took a lot of care in preparing this, all the way down to XML documentation comments. 👍

There are a few things that we might be able to tweak some further; and there's one or two things that I'm possibly not understanding correctly. Feel free to correct me if I got something wrong.

Oh btw., you should also add an entry to CHANGELOG.md (under UnreleasedAdded).

(Also, don't worry about the CodeFactor validation failure of this PR. I'll eventually deal with these "issues" by abandoning those .xdoc files through inlining their contents into the main code files.)

src/Moq/Guard.cs Show resolved Hide resolved
src/Moq/Mock.Generic.cs Outdated Show resolved Hide resolved
src/Moq/Mock.Generic.xdoc Outdated Show resolved Hide resolved
src/Moq/SetupCollection.cs Outdated Show resolved Hide resolved
src/Moq/SetupCollection.cs Outdated Show resolved Hide resolved
tests/Moq.Tests/MockedEventsFixture.cs Outdated Show resolved Hide resolved
tests/Moq.Tests/MockedEventsFixture.cs Outdated Show resolved Hide resolved
src/Moq/Interception/InterceptionAspects.cs Outdated Show resolved Hide resolved
src/Moq/MethodCall.cs Outdated Show resolved Hide resolved
src/Moq/SetupCollection.cs Outdated Show resolved Hide resolved
@stakx stakx added this to the 4.13.0 milestone Jul 19, 2019
@stakx stakx merged commit bf7ee69 into devlooped:master Jul 24, 2019
@stakx
Copy link
Contributor

stakx commented Jul 24, 2019

Thanks for the great work, @lepijohnny! 🚀

ishimko pushed a commit to ishimko/moq4 that referenced this pull request Sep 2, 2019
* WIP: initial feature commit
* Thread-safe hasEventSetup check
* Fix Resources
* PR review comments processed
* CHANGELOG.md updated
* Fix codefactor violation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants