Hi all,
I have the following class (simplified)
I want to test if the close() method is called, so I thought I could do the following:
I have the following class (simplified)
public abstract class AbstractStateMachine{ public void DoClose() { //do something close(); } public abstract void close();}I want to test if the close() method is called, so I thought I could do the following:
[TestMethod]public void TestMethod1(){ AbstractStateMachine sm = Mock.Create<AbstractStateMachine>(Behavior.CallOriginal); Mock.Arrange(() => sm.close()).DoNothing().MustBeCalled(); sm.DoClose();}As a result, I get a AccessViolationException in the sm.DoClose() method.
What am I doing wrong?
What am I doing wrong?