Thanks again for contacting us. You are getting access violation exception because DoClose
is a private method and you are trying to access it directly from test method using sm.DoClose().
However, you can write it in the following way and the test will work as expected:
AbstractStateMachine sm = Mock.Create<AbstractStateMachine>(Behavior.CallOriginal);
Mock.Arrange(() => sm.close()).DoNothing().MustBeCalled();
Hope this solves your issue.
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>