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 Moq test the right way #1397

Merged
merged 1 commit into from
Aug 23, 2017
Merged

Conversation

evildour
Copy link
Contributor

This fixes an incorrect "workaround" in #1372 for something I thought was a Moq regression, but it was just my misunderstanding how Moq works. Lesson learned: don't modify captured variables in argument match conditions for Moq setups.

@codecov
Copy link

codecov bot commented Aug 23, 2017

Codecov Report

Merging #1397 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1397   +/-   ##
=======================================
  Coverage   61.27%   61.27%           
=======================================
  Files         299      299           
  Lines        8020     8020           
=======================================
  Hits         4914     4914           
  Misses       3106     3106

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 996a3ee...6010fb5. Read the comment docs.

@evildour evildour merged commit c71f52f into googleapis:master Aug 23, 2017
@evildour evildour deleted the fix-moq-verification branch August 23, 2017 15:18
@ILMTitan
Copy link

Right, because Mock.Setup does not take a Function<...>, it takes an Expression<Function<...>>

@evildour
Copy link
Contributor Author

That was not what I got wrong. I mistakenly assumed the setup with match predicates on the arguments was validating the arguments, instead of testing them to see if the setup applies. If you're interested, here is where I realized my mistake and then had it explained to me.

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.

3 participants