Welcome to Typemock Answers. Here you can ask and receive answers from other community members. And if you liked or disliked an answer or thread: react with an up- or downvote Enjoy!

Getting generic type from a faked generic method

0 votes

Hi,

I want to fake a generic method like below:

public void foo<T>(Object params) where T : SomeType {}

I want to be able to check the actual type for T in my faked method. Is this possible?

asked Sep 5 by Ash (160 points)

1 Answer

0 votes

Hi Ash,

I didn't quite understand what is it that you want to test, but if you want to verify that the method was called you can try:

Isolate.Verify.WasCalledWithAnyArguments(() => fake.foo<SomeType>());

If that's not what you meant, please send a simple code sample.

answered Sep 5 by Raphy (1,090 points)
...