public void ShouldPassWithInOutRef() { SignatureTestTarget target = GetTarget(); string two; float three = 1.0f; target.MethodWithInOutByrefParams(1, out two, ref three, 5.0M); Assert.AreEqual("owt", two); Assert.AreEqual(3.0f, three); }
public void ShouldPassWithOutParams() { SignatureTestTarget target = GetTarget(); int first; string second; target.MethodWithOutParams(out first, out second); Assert.AreEqual(1, first); Assert.AreEqual("two", second); }
SignatureTestTarget GetTarget() { TransparentProxyInterceptor interceptor = new TransparentProxyInterceptor(); PolicySet policySet = GetPolicies(); SignatureTestTarget target = new SignatureTestTarget(); IInterceptingProxy proxy = interceptor.CreateProxy(typeof(SignatureTestTarget), target); foreach (MethodImplementationInfo method in interceptor.GetInterceptableMethods(typeof(SignatureTestTarget), typeof(SignatureTestTarget))) { HandlerPipeline pipeline = new HandlerPipeline( policySet.GetHandlersFor(method, container)); proxy.SetPipeline(method.ImplementationMethodInfo, pipeline); } return((SignatureTestTarget)proxy); }
SignatureTestTarget GetTarget() { TransparentProxyInterceptor interceptor = new TransparentProxyInterceptor(); PolicySet policySet = GetPolicies(); SignatureTestTarget target = new SignatureTestTarget(); IInterceptingProxy proxy = interceptor.CreateProxy(typeof(SignatureTestTarget), target); PipelineManager manager = new PipelineManager(); foreach (MethodImplementationInfo method in interceptor.GetInterceptableMethods(typeof(SignatureTestTarget), typeof(SignatureTestTarget))) { HandlerPipeline pipeline = new HandlerPipeline( policySet.GetHandlersFor(method, container)); manager.SetPipeline(method.ImplementationMethodInfo, pipeline); } proxy.AddInterceptionBehavior(new PolicyInjectionBehavior(manager)); return (SignatureTestTarget)proxy; }
private ISignatureTestTarget GetTarget() { var interceptor = new InterfaceInterceptor(); PolicySet policySet = GetPolicies(); var target = new SignatureTestTarget(); IInterceptingProxy proxy = interceptor.CreateProxy(typeof(ISignatureTestTarget), target); PipelineManager manager = new PipelineManager(); foreach (MethodImplementationInfo method in interceptor.GetInterceptableMethods(typeof(ISignatureTestTarget), typeof(SignatureTestTarget))) { HandlerPipeline pipeline = new HandlerPipeline( policySet.GetHandlersFor(method, container)); manager.SetPipeline(method.ImplementationMethodInfo, pipeline); } proxy.AddInterceptionBehavior(new PolicyInjectionBehavior(manager)); return((ISignatureTestTarget)proxy); }
public void ShouldPassWithVarArgs() { SignatureTestTarget target = GetTarget(); target.MethodWithVarArgs(1, "two", "two and a half", "two and three quarters"); }
public void ShouldPassWithSimpleInputs() { SignatureTestTarget target = GetTarget(); target.MethodWithSimpleInputs(1, "two"); }
public void ShouldPassWithNoParameters() { SignatureTestTarget target = GetTarget(); target.MethodWithNoParameters(); }