title: In MSTest how to check if last test passed (in TestCleanup)
body: <p>I'm creating web tests in Selenium using MSTest and want to take a screenshot everytime a test fails but I don't want to take one every time a test passes.</p>
  
  <p>What I wanted to do is put a screenshot function inside the <code>[TestCleanup]</code> method and run it if test failed but not if test passed. But how do I figure out if a last test passed?</p>
  
  <p>Currently I'm doing <code>bool = false</code> on <code>[TestInitialize]</code> and <code>bool = true</code> if test runs through.</p>
  
  <p>But I don't think that's a very good solution.</p>
  
  <p>So basically I'm looking for a way to detect if last test true/false when doing <code>[TestCleanup]</code>.</p>