Hi,
I am not sure about the implementation of
SomeFunction, but I'll show an example of how to invoke an extension method using
Invoke API.
[TestMethod]
public void test()
{
var someClass = new SomeClass();
bool result = (bool)Isolate.Invoke.Method(typeof(SomeClassExtensions), "SomeFunction", someClass);
Assert.IsTrue(result);
}
Where the extension method is:
public static class SomeClassExtensions
{
public static bool SomeFunction(this SomeClass someClass)
{
return true;
}
}
The invocation is performed on the extension method class and the argument sent is the object itself. In this example:
Isolate.Invoke.Method(
typeof(SomeClassExtensions), // The extension methods class
"SomeFunction", // The extension method name
someClass) // The object on which the method needs to be invoked
Please let me know if it helps.
Regards,
Elisha,
Typemock Support