How to verify a contextual condition when a method is called with Moq <p>I'm using Moq and I need to check a condition when a mock method is called. Into following example i try to read the Property1 property, but this could be any expression:</p> <pre><code>var fooMock = new Mock&lt;IFoo&gt;(); fooMock.Setup(f =&gt; f.Method1()) .Returns(null) .Check(f =&gt; f.Property1 == true) // Invented method .Verifiable(); </code></pre> <p>My final objective is to check if a condition is true when the method is called. How can I perform this?</p>