Hi Team,
We are upgrading Typemock from version 8.4 to version 8.6(TypemockIsolatorSuite-8.6.0.10.921967232). I got an exception in one of the test,
Please find the following code snippet simplifies and illustrates the issue
Sample C#.Net Code
public class Class1
{
private Class2 _c2;
public Class1(Class2 c2)
{
_c2 = c2;
}
public void Method1()
{
Test t;
_c2.TestMtd("Testing", out t);
}
}
public class Class2
{
public void TestMtd(string test, out Test t)
{
t = new Test();
}
}
public classTest : IConvertible
{
// please implement all the methods from IConvertible, here space is not allowed
}
Typemock UnitTest Code
[TestClass]
public class UnitTest1
{
[TestInitialize]
public void MyTestInitialize()
{
MockManager.Init();
}
[TestMethod]
public void TestMethod1()
{
Class2 c2 = Isolate.Fake.Instance<Class2>();
Class1 obj = new Class1(c2);
Test t;
Isolate.WhenCalled(() => c2.TestMtd("test1", out t)).DoInstead(context =>
{
t = new Test();
context.Parameters[1] = t;
});
obj.Method1();
}
}
In the above code, the second parameter I am passing is class inherited from IConvertible. Below exception occurred.
The same code is working fine in TypeMock Version 8.4. Please help us to resolve in Typemock 8.6 Version.