title: Classes marked with TestInitialize and TestCleanup not executing
body: <p>I have been struggling with this one, hopefully it will help someone else.</p>
  
  <p>Whilst creating unit tests using MsTest I discovered I was repeating the same code in each test, and found a couple of handy attributes (<code>TestInitialize</code>, <code>TestCleanup</code>, <code>ClassInitialize</code>, and <code>ClassCleanup</code>).</p>
  
  <p>Supposedly, when you mark a method with one of these attributes, it should execute automatically (prior to each test, after each test, prior to all tests, and after all tests respectively). Frustratingly, this did not happen, and my tests failed. If directly calling these methods from the classes marked with <code>TestMethod</code> attribute, the tests succeeded. It was apparent they weren't executing by themselves.</p>
  
  <p>Here is some sample code I was using:</p>
  
  <pre><code>[TestInitialize()]
  private void Setup()
  {
      _factory = new Factory();
      _factory.Start();
  }
  </code></pre>
  
  <p>So why is this not executing?</p>