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
0 votes
I have a private static method as follows -
private static List<String> Method (string name, params object[] parameters)
//method body

The following verify fails when the arguments actually match –
Isolate.Verify.NonPublic.WasCalled(typeof(MyClass), "Method").WithArguments(name, param1, param2, param3);

For testing, I modified my method to be internal instead of private and tested with the public accessor – which passes.
Isolate.Verify.WasCalledWithExactArguments(() => MyClass. Method( name, param1, param2, param3));

Is there something different that needs to be done for nonpublic methods? Is this a bug?

asked by Debbie (600 points)

1 Answer

0 votes
Hi Debbie,

I can confirm that you found a bug :oops: . NonPublic Verify does not handle the variable length params argument properly.

I will open this defect in our bug tracking system and try to send you a working patch as soon as possible.

Typemock Support
answered by doron (17.2k points)