I have the following class:
public abstract class Command
{
public Command() { }
public void Execute()
{
InnerExecute();
}
protected abstract void InnerExecute();
}
and The following test:
[TestMethod]
public void Execute_StandardExecution_InnerExecuteWasCalled()
{
var fakeCommand = Isolate.Fake.Instance<Command>(Members.CallOriginal);
fakeCommand.Execute();
Isolate.Verify.NonPublic.WasCalled(fakeCommand,"InnerExecute");
}
running this test result in:
Test method Crap4NetTests.BasicCommandTest.Execute_StandardExecution_InnerExecuteWasCalled threw exception: TypeMock.VerifyException:
TypeMock Verification: Method Mock0000Command.InnerExecute() was expected but was not called.
any idea why this is so?
:!: making InnerExecute public and using "regular" verify seems to work just fine