Can not access underlying object of a Mock : <p>I have the following code in a unit test where I am using <code>Moq</code>:</p>

<pre><code>Mock&lt;BorderedCanvas&gt; canvas2 = new Mock&lt;BorderedCanvas&gt;();
canvas2.Object.Children.Add(canvas1);
canvas1.RaiseEvent(someEvent);
canvas2.Verify(c =&gt; c.RaiseEvent(It.IsAny&lt;RoutedEventArgs&gt;()), Times.Once);
</code></pre>

<p>The code fails on the second line with this message:</p>

<pre><code>System.NullReferenceException : Object reference not set to an instance of an object.
</code></pre>

<p>Any idea why I can not access the underlying object of the mock <code>canvas2</code>?</p>
