コード例 #1
0
        void SetAutoBody(IndirectionStubSpecimen stub, ISpecimenContext context)
        {
            var proxy      = default(MockProxy);
            var dlgtType   = default(Type);
            var dlgtMethod = default(MethodInfo);

            using (InstanceGetters.DisableProcessing())
            {
                dlgtType   = stub.IndirectionDelegate;
                dlgtMethod = stub.IndirectionDelegateMethod;
            }
            proxy = GetAutoMock(dlgtType, dlgtMethod, context);
            stub.SetBody(proxy.Object);

            using (InstanceGetters.DisableProcessing())
                m_ms.Assign(stub.CallableTarget, proxy);
        }