Hi,
Thanks for your reply.
I did some more investigation, and I think the problem is,
in my overloaded function I actually call the other version of the function.
So let's say I have:
// 1st version
private Tool AddToolToBand(string toolName, int toolID, ref Band aBand)
{
...
}
//2nd version
private Tool AddToolToBand(string toolName, int toolID, ref Band aBand, ToolStyles toolStyle, ToolTypes toolType, string caption, string toolTip, string shorcut, stdole.StdPicture toolPic)
{
//call to 1st version
Tool aTool = AddABToolToBand(toolName, toolID, ref aBand);
//do other stuff
...
}
And my test code for the 2nd version of AddToolToBand:
public void AddToolToBandOverloadTest()
{
...
Tool retTool = null;
//try to mock the call to the first version
mockMyClass.ExpectAndReturn("AddToolToBand", retTool).Args("toolName", 1, aBand);
...
//call the 2nd version under test
accessor.AddToolToBand([9 arguments]);
}
The error is TypeMock Verification: Call to AddToolToBand() 3 Parameters expected but received 9. When I debug through it, it goes to the right version of the function, but doesn't enter and ends right away.
It is as if TypeMock is trying to mock the function I'm actually trying to test (1st version), because I have mocked the 1st version.
Is TypeMock able to handle this?
Also, as a side question, how do I deal with ref arguments when I want to check for arguments of an expected function (as I would have to do above with Band?)
Thanks,
YFC