NUnit ExceptedException

Ask general questions here.
SanMan
Posts: 151
Joined: Tue Apr 13, 2010 9:59 am

NUnit ExceptedException

Post by SanMan » Wed May 05, 2010 2:45 pm

newby question;

How to use [ExceptedException] in testcase?

I have added this [ExceptedException] under [Test] and run the case:
-> if case succees, NUnit shows it fails: Test_try: An Exception was excepted
-> if case fails, NUnit shows also it fails and I am happy :D

But if I remove the [ExceptedException]
-> if case succees, NUnit shows it succees and I am happy :)
-> if case fails, NUnit shows it succees and I amnot happy :(

Is there some very simple example how to use this [ExceptedException]?
Should the be added some ".Throw" stuff?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: NUnit ExceptedException

Post by Support Team » Wed May 05, 2010 4:55 pm

Hi!

Ranorex Support Team
SanMan wrote:Is there some very simple example how to use this [ExceptedException]?
Please see following Link form NUnit http://www.nunit.org/index.php?p=exception&r=2.4
This documentation includes all the stuff you need.

Regards,
Peter
Ranorex Support Team
.
Image