title: How to force fail a test in C# with MSTest
body: <p>I am trying to port some of my WebDriver tests from JAVA to C#. What I'm stuck on is the situation when the driver cannot find some element on the page, in JAVA I do :</p>
  
  <pre><code>if (second &gt;= 10) fail("timeout - " + list);
  </code></pre>
  
  <p>so if something takes more than 10 seconds the test fails with the timeout message. 
  I tried a similar approach in C# with </p>
  
  <pre><code>if (sec &gt;= 10) Debug.Fail("timeout : " + vList);
  </code></pre>
  
  <p>but this actually did not fail the test, but gave me an option to do so with the exception message box. That was a no no, I need my automatic test to fail outright on its own. Then I tried </p>
  
  <pre><code>if (sec &gt;= 10) Assert.Fail("timeout : " + vList);
  </code></pre>
  
  <p>but this is throwing an unhandled exception error. Should I enclose the Assert.Fail in try/catch block? Or should I use something completely different to fail the test?</p>
  
  <p>I am using MSTest, as mentioned in the topic.</p>
  
  <p><strong>EDIT</strong>: The exact message is : </p>
  
  <blockquote>
    <p>AssertFailedException was unhandled by user code. Assert.Fail failed.
    timeout : someField.</p>
  </blockquote>
  
  <p>on </p>
  
  <blockquote>
    <p>Assert.Fail("timeout : " + vList);</p>
  </blockquote>