public void CanCallMethodWithOutParameter() { int i; WithCallbackInterceptor interceptor = new WithCallbackInterceptor(delegate { }); IWithRefOut proxy = (IWithRefOut)generator.CreateInterfaceProxyWithoutTarget(typeof(IWithRefOut), interceptor); proxy.Do(out i); }
public void CanCreateProxyWithRefParam() { int i = 3; WithCallbackInterceptor interceptor = new WithCallbackInterceptor(delegate(IInvocation invocation) { invocation.Arguments[0] = 5; }); IWithRefOut proxy = (IWithRefOut)generator.CreateInterfaceProxyWithoutTarget(typeof(IWithRefOut), interceptor); proxy.Did(ref i); Assert.AreEqual(5, i); }
public void CanAffectValueOfOutParameter() { int i; WithCallbackInterceptor interceptor = new WithCallbackInterceptor(delegate(IInvocation invocation) { invocation.Arguments[0] = 5; }); IWithRefOut proxy = (IWithRefOut)generator.CreateInterfaceProxyWithoutTarget(typeof(IWithRefOut), interceptor); proxy.Do(out i); Assert.AreEqual(5, i); }