Drawing.Image Not allowed in Moq or Unit Test?
<p>I'm attempting to unit test a method that loads an Image (of type Image, not the file path) onto a Virtual machine stack.</p>

<p>I have a <code>Verify</code> call that looks like this:</p>

<p><code>mockVM.Verify(q =&gt; q.Stack.Push(It.IsAny&lt;Image&gt;()), Times.AtLeastOnce());</code></p>

<p>In order to check wether the following <code>Stack.Push</code> call occurred in the method under test. The pertinent parts of this method are thus:</p>

<pre><code>Image newImage = Image.FromFile(@"" + Operands[0]);
VirtualMachine.Stack.Push(newImage);
Console.WriteLine("Hit loadimage");
</code></pre>

<p>In the class under test I am using <code>System.Drawing</code> perfectly fine in order to use Image as a type.</p>

<p>However in the Unit test code, despite using <code>System.Drawing</code> or any variant, I get an error under Image in <code>It.IsAny&lt;Image&gt;()</code>.</p>

<blockquote>
  <p>The type or namespace name 'Image' could not be found (are you missing
  a using directive or an assembly reference?)</p>
</blockquote>

<p>I want to verify that an object of type image was placed on the stack, but not being able to use <code>Image</code> as a type is a problem and I can't progress. </p>

<p>Is there some reason why I can't use <code>System.Drawing</code> in the unit test? Or is there an easy way to achieve my aim. </p>