chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
Why is it that we must use

  Isolate.WhenCalled(()=>fake.method()).IgnoreCall()


instead of
  Isolate.WhenCalled(fake.method).IgnoreCall()


The second call will generate a typemockexception, and the exception adviced me to use the first call.

But I thought these two calls are equivalent in the sense that they generate the same IL?
________
Suzuki Dl650 Vstrom
asked by nsoonhui (59.1k points)

1 Answer

0 votes
Soon Hui,

Currently this is a limitation of Isolator - we decided not to allow method group format, but rather only lambda expression to be used in WhenCalled(). I will put this up for discussion again and we'll look into whether we want to change it.

Thanks for pointing this out.

Doron
Typemock Support
answered by doron (17.2k points)
...