Top "Expected-exception" questions

ExpectedException Attribute Usage

I am trying to work with the ExpectedException attribute in a C# UnitTest, but I am having issues getting it …

c# unit-testing exception expected-exception
How do I enforce exception message with ExpectedException attribute

I thought these two tests should behave identically, in fact I have written the test in my project using MS …

c# unit-testing nunit mstest expected-exception
ExpectedException Assert

I need to write a unit test for the next function and I saw I can use [ExpectedException] this is …

c# unit-testing testing expected-exception
How to continue test after JUnit ExpectedException if thrown?

I have set up some JUnit (4.12) test with the ExpectedException feature, and I would like the test to continue after …

java junit4 expected-exception junit-rule
How do I get SpecFlow to expect an exception?

I'm using SpecFlow, and I'd like to write a scenario such as the following: Scenario: Pressing add with an empty …

specflow expected-exception
Multiple expected exceptions in JUnit

The application is throwing 2 different exceptions in some thatMethod(). I'm looking to test it by JUnit. I can use ExpectedException …

exception junit expected-exception