예제 #1
0
        public void Process(Invocation invocation)
        {
            var delegatedInvocation = new Invocation(
                MockingUtil.TryGetUninitializedObject(invocation.Method.GetReturnType()),
                delegatedMock.CallPattern.Method,
                new object[0]);

            this.delegatedMock.Repository.DispatchInvocation(delegatedInvocation);

            if (delegatedInvocation.IsReturnValueSet)
            {
                invocation.ReturnValue = delegatedInvocation.ReturnValue;
            }

            invocation.CallOriginal = delegatedInvocation.CallOriginal;
            invocation.UserProvidedImplementation = delegatedInvocation.UserProvidedImplementation;
            invocation.ExceptionThrower           = delegatedInvocation.ExceptionThrower;

            if (invocation.CallOriginal)
            {
                ProfilerInterceptor.SkipMethodInterceptionOnce(delegatedMock.CallPattern.Method);
            }
        }