title: How do I MOQ the System.IO.FileInfo class... or any other class without an interface?
body: <p>I am writing a number of unit tests for a logger class I created and I want to simulate the file class.  I can't find the interface that I need to use to create the MOQ... so how do you successfully MOQ a class without an interface?</p>
  
  <p>It also isn't clear to me how I can use dependency injection without having an interface available:</p>
  
  <pre><code>private FileInfo _logFile;
  
  public LogEventProcessorTextFile(FileInfo logFile) {
      _logFile = logFile;
  }
  </code></pre>
  
  <p>When I really want to do something like this (note IFileInfo instead of FileInfo):</p>
  
  <pre><code>private IFileInfo _logFile;
  
  public LogEventProcessorTextFile(IFileInfo logFile) {
      _logFile = logFile;
  }
  </code></pre>