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

Documentation Correction around using Verify() #332

Closed
jcockhren opened this issue Mar 18, 2017 · 3 comments
Closed

Documentation Correction around using Verify() #332

jcockhren opened this issue Mar 18, 2017 · 3 comments

Comments

@jcockhren
Copy link
Contributor

Hello, I'm an instructor at the Nashville Software School and my students and I are using Moq for testing. While working through an in-class example, we noticed what seemed to be a typo in the documentation describing how to use Verify(). When applying the instructions, intelli-sense complains and compilation fails. Considering the example from the docs:

var mock = new Mock<IWarehouse>();
this.Setup(x => x.HasInventory(TALISKER, 50)).Verifiable().Returns(true);

According to the interface IVerifies and documention, Verifiable() return type is void and therefore calling .Returns(true) on a void causes compilation to fail and Intelli-sense yells: Operator '.' cannot be applied to operand of type void.

@jcockhren jcockhren changed the title Documentaion Correction around using Verify() Documentation Correction around using Verify() Mar 18, 2017
@jessicakilby
Copy link

Thanks for showing us! 👍

@tkylesh
Copy link

tkylesh commented Mar 20, 2017

👍

@stakx
Copy link
Contributor

stakx commented Jun 2, 2017

Thanks! Please note that at the moment, this correction won't be seen on NuDoq, since NuDoq doesn't have the documentation for the latest version of Moq. I'll try to follow up on this in #354.

@stakx stakx closed this as completed Jun 2, 2017
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

4 participants