I need to check the type of a mock object and want to get the underlying type. For instance, for an object such as Mock is there anything on here I can call to get the type, "Foo"? I am using moq.
Mock<Foo> myFoo = new Mock<Foo>
myFoo.Object.?
myFoo.?
Type t = myFoo.GetType().GetGenericArguments().First();
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