How does NSubstitute .Returns<T>() work?
<p>How does the <code>.Returns&lt;T&gt; (this T value, ... )</code> extension method work under the hood?</p>

<p>Specifically, how does <code>.Returns</code> know what method it is intended to configure just from the result of executing that method?</p>

<p>Example:</p>

<pre><code>public interface ICalculator { Add(int a, int b); }

// create mock
var calculator = Substitute.For&lt;ICalculator&gt;();

// How does this piece work under the hood?
calculator.Add(1, 2).Returns(3);
</code></pre>