Using NUnit 2.5.10 , I am testing code that references a library containing the base type of an exception. TIBCO.EMS.NamingException from which other types of exceptions are thrown, in particular TIBCO.EMS.InvalidNameException and TIBCO.EMS.NameNotFoundException .
I would like to use the NUnit ExpectedException attribute to recognize when any subclass exception was thrown from TIBCO.EMS.NamingException .
I can easily detect when a particular exception was thrown:
[ExpectedException("TIBCO.EMS.NameNotFoundException")] or [ExpectedException(Typeof(TIBCO.EMS.InvalidNameException))]
But I would like to somehow make NUnit "wait" if any subclass of TIBCO.EMS.NamingException .
Trying it directly does not work:
[ExpectedException("TIBCO.EMS.NamingException")] or [ExpectedException(typeof(TIBCO.EMS.NamingException))]
Any ideas?
source share