The [ExpectedArgumentException] is used to test to make sure that an exception is thrown. If it is not thrown, then you get a failed test with an ExpectedExceptionNotThrownException (or something like that).
Make sure that you specify the typeof exception you are looking for at the finest granularity you can. If you set the typeof to be Exception, than any exception thrown will pass. If you want ArgumentNullExpection to fail, then specify the exact exception you are looking for (e.g. ArgumentOutOfRangeException) Phil Philip Japikse, MCSD.Net, MCDBA, CSM Principal Consultant Pinnacle Solutions, Inc [EMAIL PROTECTED] www.japikse.blogspot.com twitter/skimedic (513) 312-5664 -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Hugh Sent: Wednesday, December 10, 2008 4:11 PM To: MbUnit.User Subject: MbUnit ExpectedArgumentException strangeness Here's what I observe in a test fixture I'm writing: Given: a test method decorated with [ExpectedArgumentException]. When: the system under test throws an ArgumentNullException. Then: The test passes. This seems wrong to me... Am I misundertanding the semantics of ExpectedArgumentException? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "MbUnit.User" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/MbUnitUser?hl=en -~----------~----~----~----~------~----~------~--~---
