I am trying to develop an NUnit addin that dynamically adds test methods to a suite from an object that contains a list of Action
delegates. The problem is that NUnit appears to be leaning heavily on reflection to get the job done. Consequently, it looks like there's no simple way to add my Action
s directly to the suite.
I must, instead, add MethodInfo
objects. This would normally work, but the Action
delegates are anonymous, so I would have to build the types and methods to accomplish this. I need to find an easier way to do this, without resorting to using Emit
. Does anyone know how to easily create MethodInfo instances from Action delegates?
Have you tried Action's Method property? I mean something like:
MethodInfo GetMI(Action a)
{
return a.Method;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With