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(); }
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 void Process(RemotingProxy proxy) { MockInstance = proxy.MockInstance; }