/// <summary> /// Call the original method on the class, optionally bypassing the mocking layers /// </summary> /// <returns></returns> public IMethodOptions <T> CallOriginalMethod(OriginalCallOptions options) { AssertMethodImplementationExists(); if (options == OriginalCallOptions.NoExpectation) { proxy.RegisterMethodForCallingOriginal(expectation.Method); repository.Recorder.RemoveExpectation(expectation); expectation.RepeatableOption = RepeatableOption.OriginalCallBypassingMocking; } else { expectation.RepeatableOption = RepeatableOption.OriginalCall; } return(this); }
/// <summary> /// Call the original method on the class, optionally bypassing the mocking layers, for the last call. /// </summary> public static IMethodOptions <object> CallOriginalMethod(OriginalCallOptions options) { return(GetOptions <object>().CallOriginalMethod(options)); }