0

Am I correct in thinking that you can't run this code:

Assert.Throws<FormatException>(()=> 
{
     int test;
     test = int.Parse("forty two");

});

in debug mode? It will throw an error and that error will not be caught by the

Assert.Throws<FormatException>

So the test will fail.

Paul Stanley
  • 1,999
  • 1
  • 22
  • 60

1 Answers1

1

Take a look to this, How to prevent expected exceptions from breaking the debug test run?

Probably is your Visual Studio settings that are wrong, not xunit

MrVoid
  • 709
  • 5
  • 19