internal object CreateMockRemoting(Type type, IInterceptor interceptor, IMockInstance instance)
        {
            if (!type.IsInterface && !typeof(MarshalByRefObject).IsAssignableFrom(type))
            {
                var message = string.Format(
                    "Cannot create Remoting Proxy. \"{0}\" is not derived from MarketByRefObject",
                    type.Name);

                throw new InvalidCastException(message);
            }

            return(new RemotingProxy(type, interceptor, instance)
                   .GetTransparentProxy());
        }
        internal object CreateMockRemoting(Type type, IInterceptor interceptor, IMockInstance instance)
        {
            if (!type.IsInterface && !typeof(MarshalByRefObject).IsAssignableFrom(type))
            {
                var message = string.Format(
                    "Cannot create Remoting Proxy. \"{0}\" is not derived from MarketByRefObject",
                        type.Name);

                throw new InvalidCastException(message);
            }

            return new RemotingProxy(type, interceptor, instance)
                .GetTransparentProxy();
        }
示例#3
0
 public RemotingProxy(Type type, IInterceptor interceptor, IMockInstance instance)
     : base(type)
 {
     this.interceptor = interceptor;
     this.instance = instance;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="instance"></param>
 public ProxyInterceptor(IMockInstance instance)
 {
     this.instance = instance;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="instance"></param>
 public MockInterceptor(IMockInstance instance)
 {
     this.instance = instance;
 }
 public RemotingProxy(Type type, IInterceptor interceptor, IMockInstance instance)
     : base(type)
 {
     this.interceptor = interceptor;
     this.instance    = instance;
 }
 public void Process(RemotingProxy proxy)
 {
     MockInstance = proxy.MockInstance;
 }
示例#8
0
 public void Process(RemotingProxy proxy)
 {
     MockInstance = proxy.MockInstance;
 }