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 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!
0 votes
This test throws an IndexOutOfRangeException because .Matching() tries to match the first argument to "a.B", which has zero arguments, when what the user wants is to match the first argument to "a.B.BMethod()". I expect a NestedCallException here instead of an IndexOutOfRangeException.

[ img ]
Code for the above: http://pastebay.com/pastebay.php?dl=77544

How to make the IndexOutOfRangeException go away:
[ img ]
asked by (27.7k points)

4 Answers

0 votes
Neil,

I'll need to take a close look at this. It seems to me that the result should be the same for both tests, and certainly not the IndexOutOfRangeException you received. Let us check this out and get back to you.

Thanks,
Doron
Typemock Support
answered by (16.5k points)
0 votes
Thanks Doron.
answered by (27.7k points)
0 votes
Hi Neil,

Thanks for reporting. The VerifyWasCalled with Matching does not support chained calls. It should have stated this in the exception but it didn't and it's a bug.

The solution is as you showed in the example - store the chain in variable before performing the verification.

Regards,
Elisha,
Typemock Support
answered by (12k points)
0 votes
Thanks Elisha.
answered by (27.7k points)
...