public void SetUp()
        {
            // Ensure all classes are loaded and initialized.
            var proxyFactory = new LinFu.Proxy.ProxyFactory();
            var interceptor  = new LinFuInterceptor(new Standard());

            proxyFactory.CreateProxy <IStandard>(interceptor);
        }
        public void MethodInvocationWithGenericParameterTest(int iterations)
        {
            var proxyFactory = new LinFu.Proxy.ProxyFactory();
            var interceptor = new LinFuInterceptor(new Generic());
            var proxy = proxyFactory.CreateProxy<IGeneric>(interceptor);
            var stopwatch = new Stopwatch();

            stopwatch.Start();

            for (var i = 0; i < iterations; i++)
            {
                proxy.Invoke(i);
            }

            stopwatch.Stop();

            Report.Instance.Write(AssemblyName, Scenario.MethodInvocationWithGenericParameter, iterations, stopwatch.Elapsed);
        }
        public void MethodInvocationWithGenericParameterTest(int iterations)
        {
            var proxyFactory = new LinFu.Proxy.ProxyFactory();
            var interceptor  = new LinFuInterceptor(new Generic());
            var proxy        = proxyFactory.CreateProxy <IGeneric>(interceptor);
            var stopwatch    = new Stopwatch();

            stopwatch.Start();

            for (var i = 0; i < iterations; i++)
            {
                proxy.Invoke(i);
            }

            stopwatch.Stop();

            Report.Instance.Write(AssemblyName, Scenario.MethodInvocationWithGenericParameter, iterations, stopwatch.Elapsed);
        }
        public void ProxyInstantiationTest(int iterations)
        {
            var proxyFactory = new LinFu.Proxy.ProxyFactory();
            var interceptor  = new LinFuInterceptor(new Standard());
            var stopwatch    = new Stopwatch();

            proxyFactory.CreateProxy <IStandard>(interceptor);

            stopwatch.Start();

            for (var i = 0; i < iterations; i++)
            {
                proxyFactory.CreateProxy <IStandard>(interceptor);
            }

            stopwatch.Stop();

            Report.Instance.Write(AssemblyName, Scenario.ProxyInstantiation, iterations, stopwatch.Elapsed);
        }
        public void ProxyGenerationWithGenericParameterTest(int iterations)
        {
            var interceptor = new LinFuInterceptor(new Generic());
            var stopwatch   = new Stopwatch();

            for (var i = 0; i < iterations; i++)
            {
                var proxyFactory = new LinFu.Proxy.ProxyFactory {
                    Cache = new LinFuProxyCache()
                };

                stopwatch.Start();

                proxyFactory.CreateProxy <IGeneric>(interceptor);

                stopwatch.Stop();
            }

            Report.Instance.Write(AssemblyName, Scenario.ProxyGenerationWithGenericParameter, iterations, stopwatch.Elapsed);
        }
        public void ProxyGenerationTest(int iterations)
        {
            var interceptor = new LinFuInterceptor(new Standard());
            var stopwatch = new Stopwatch();

            for (var i = 0; i < iterations; i++)
            {
                var proxyFactory = new LinFu.Proxy.ProxyFactory {Cache = new LinFuProxyCache()};

                stopwatch.Start();

                proxyFactory.CreateProxy<IStandard>(interceptor);

                stopwatch.Stop();
            }

            Report.Instance.Write(AssemblyName, Scenario.ProxyGeneration, iterations, stopwatch.Elapsed);
        }
        public void SetUp()
        {
            // Ensure all classes are loaded and initialized.
            var proxyFactory = new LinFu.Proxy.ProxyFactory();
            var interceptor = new LinFuInterceptor(new Standard());

            proxyFactory.CreateProxy<IStandard>(interceptor);
        }