Inheritance: IInterceptor
コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
        }