Beispiel #1
0
        MockProxy GetAutoMock(Type dlgtType, MethodInfo dlgtMethod, ISpecimenContext context)
        {
            Debug.Assert(dlgtType.IsSubclassOf(typeof(Delegate)));
            var proxy = default(MockProxy);

            using (InstanceGetters.DisableProcessing())
            {
                var createMethod     = m_ms.GetType().GetMethod("Create", Type.EmptyTypes);
                var createMethodInst = createMethod.MakeGenericMethod(dlgtType);
                proxy = (MockProxy)createMethodInst.Invoke(m_ms, null);
            }
            DoSetupForAutoMock(proxy, dlgtMethod, context);
            return(proxy);
        }