Hi,
I have a unit test where I assert that a certain action will call a method on a mock dependency object by using Mock.Assert(). I want to ensure that the action I take calls the method on the mock object exactly once. The problem is that the setup of the unit test creates a scenario where the method of the mock object will also be called, so when I assert that the call to the mock object happened just once it fails because it has actually been called more than once.
Is there a way to "reset" the call tracking of methods on mock objects? I basically want to tell JustMock that at a certain point, whatever calls have happened to my mock objects should be discarded and the call counter should basically start at 0 again.
Am I missing something in the framework or is there another way I should do this?
Jerrie
I have a unit test where I assert that a certain action will call a method on a mock dependency object by using Mock.Assert(). I want to ensure that the action I take calls the method on the mock object exactly once. The problem is that the setup of the unit test creates a scenario where the method of the mock object will also be called, so when I assert that the call to the mock object happened just once it fails because it has actually been called more than once.
Is there a way to "reset" the call tracking of methods on mock objects? I basically want to tell JustMock that at a certain point, whatever calls have happened to my mock objects should be discarded and the call counter should basically start at 0 again.
Am I missing something in the framework or is there another way I should do this?
Jerrie