title: How do I programmatically pause a unittest?
body: <p>I'm using visual-studio built-in unit-testing framework - <code>Microsoft.VisualStudio.TestTools.UnitTesting</code> namespace.</p>
  
  <p><strong>I need to pause unit-test execution from the test code (and, preferably, allow the developer to resume the test by pressing some button or something).</strong></p>
  
  <p>Is there any built-in way to do that?</p>
  
  <p>I know I can use a <code>Thread.Sleep()</code> to simply pause for several seconds, but is there a way to pause/resume or prompt the user somehow? Probably another obvious solution would be to call <code>MessageBox.Show()</code> but that'd require a reference to the whole Windows.Forms family...</p>
  
  <p>P.S. The reason behind this: I have a "fuzzy" integration test that <em>sometimes</em> fails, but I can't tell why exactly (it's a UI test that automates a browser via <code>Selenium</code>, and the browser screen flashes quickly and I can't tell what happened there...). And for some reason I cannot catch this failure when debugging a test, only when running it regularly...</p>
  
  <p>UPDATE: I guess there's no built-in way to do that, and it actually makes sense, since <strong>tests should run without any user interaction</strong> by design. Guess, a simple <code>Sleep()</code> or even <code>Console.ReadLine()</code> to simply freeze execution, until developer clicks "cancel" in the test-explorer.</p>