I am interested in writing a method that would accept another method as a parameter but do not want to be locked into a specific signature - because I don't care about that. I am only interested whether the method throws an exception when invoked. Is there a construct in the .NET Framework that will allow me to accept any delegate as a parameter?
For example, all of the following calls should work (without using overloads!):
DoesItThrowException(doSomething(arg));
DoesItThrowException(doSomethingElse(arg1, arg2, arg3, arg4, arg5));
DoesItThrowException(doNothing());