public void HandleMockInvocation(IInvocation invocation) { this.lastInvocation = invocation; GetInvocationCounter(invocation).Add(NMockitoInvocationCounters.TakeNextInvocationCounter()); invocation.ReturnValue = GetInvocationResult(invocation); NMockitoGlobals.SetLastInvocationAndMockState(invocation, this); }
public WhenContext() { invocationAndMockState = NMockitoGlobals.GetLastInvocationAndMockState(); invocationAndMockState.State.DecrementInvocationCounter(invocationAndMockState.Invocation); smartParameters = NMockitoSmartParameters.CopyAndClearSmartParameters(); }