[Test]
[ExpectedException(typeof(StupidException))]
public void TestStupidException()
{
     throw new StupidException();
}

The above test should pass (unless i've done it wrong ;) ).You can also
check to make sure the message is the same by doing the following:


[Test]
[ExpectedException(typeof(StupidException), Message="You forgot to catch the
stupid exception")]
public void TestStupidException()
{
     throw new StupidException("You forgot to catch the stupid exception");
}


On 3/9/07, Dennis Hayes <[EMAIL PROTECTED]> wrote:

Can someone point me to a Mono test case that checks for an expected
execption?
Dennis


------------------------------
Don't be flakey. Get Yahoo! Mail for 
Mobile<http://us.rd.yahoo.com/evt=43909/*http://mobile.yahoo.com/mail>and
always stay 
connected<http://us.rd.yahoo.com/evt=43909/*http://mobile.yahoo.com/mail>to 
friends.


_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to