My assembly has several classes that have these fields:
private static Foo MyFoo = new Foo(typeof(Bar));
The argument typeof(Bar)is different for each class.
In my unit tests, I need to extract this argument dynamically.
I can find all classes and filter those that have a static field Foo. Then I have it FieldInfo.
But then I do not know how to get the type of this argument?
source
share