title: Testing a Class with a Static Class/method dependency
body: <p>So I have a class that looks like this:</p>
  
  <pre><code>public class MyClassToTest()
  {
      MyStaticClass.DoSomethingThatIsBadForUnitTesting();
  }
  </code></pre>
  
  <p>and a static class that looks like this:</p>
  
  <pre><code>public static class MyStaticClass()
  {
      public static void DoSomethingThatIsBadForUnitTesting()
      {
          // Hit a database
          // call services
          // write to a file
          // Other things bad for unit testing
      }
  }
  </code></pre>
  
  <p>(Obviously this is a dumbed down example)</p>
  
  <p>So, I know that the second class is doomed when it comes to unit testing, but is there any way to uncouple the <code>MyClassToTest</code> class so that I can test it (WITHOUT instantiating <code>MyStaticClass</code>).  Basically, I would want it to ignore this call.</p>
  
  <p>Note: Sadly this is a Compact Framework Project, so tools like Moles and Typemock Isolator cannot be used :(.</p>