public void MethodInvocationTest(int iterations) { var proxyGenerator = new ProxyGenerator(); var interceptors = new IInterceptor[] {new CastleInterceptor()}; var target = new Standard(); var proxy = proxyGenerator.CreateInterfaceProxyWithTarget<IStandard>(target, interceptors); var stopwatch = new Stopwatch(); stopwatch.Start(); for (var i = 0; i < iterations; i++) { proxy.Invoke(i); } stopwatch.Stop(); Report.Instance.Write(AssemblyName, Scenario.MethodInvocation, iterations, stopwatch.Elapsed); }
public void SetUp() { // Ensure all classes are loaded and initialized. var proxyGenerator = new ProxyGenerator(); var interceptors = new IInterceptor[] {new CastleInterceptor()}; var target = new Standard(); proxyGenerator.CreateInterfaceProxyWithTarget<IStandard>(target, interceptors); }