Open Miista opened 4 months ago
I get the same exception when a method is called on a mocked dependency:
class Foo {
public Foo(ISomeDependency dep) {
_dep = dep;
}
public void DoSomething() {
_dep.DoSomething<string>("foo");
}
}
class FooTests {
void TestForDoSomething() {
var fixture = new Foo(MockedDependency);
PoseContext.Isolate(() =>
{
actual = fixture.DoSomething();
}, shim);
}
}
Is this the same problem, because I am also using a generic method (DoSomething<string>()
) inside an instance method or should I open a new issue?
@mamen It might be. It could be related to how the constrained
instruction is handled in the rewrite process (see #49). I believe that the current implementation is incorrect in that it never executes the replacement method.
MVE:
Rewriting
GetTFromAbstractBase
results inSystem.BadImageFormatException: An attempt was made to load a program with an incorrect format. (0x8007000B)
.This issue was discovered during Miista/pose#34