Pex: How to indicate in a parameterized test that I expect an exception under certain conditions?

StackOverflow https://stackoverflow.com/questions/4684074

  •  11-10-2019
  •  | 
  •  

Question

I'm just getting started with Pex and running into an issue as described in the title. It seems that any parameterized tests generated by Pex or added by hand will create failing test cases for any inputs that cause an exception to be raised. Is there a way for me to indicate that certain inputs should raise exceptions, and therefore not cause a specific test to fail?

Was it helpful?

Solution

If you select the failing in test there is an 'Allow Exception' option which tells pex that the exception is correct behaviour.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top