title: How can I mock System.Net.Mail.Attachment with moq?
body: <p>I want to write a unit-test for the following codesnippet:</p>
  
  <pre><code>var attachment = new Attachment(path)
  {
     ContentId = Path.GetFileName(path)
  };
  
  return attachment;
  </code></pre>
  
  <p>Unfortunately the Attachment ctor throws a FileNotFoundException if I call the ctor with a fake path in the unit-test code.</p>
  
  <p>How can I mock this code that I can verifiy whether the ContentId property was set correctly? I don't want to test the framework code.</p>