protected WhenExceptionInterceptingSynchronousResultMethodsBase(int msDelay)
        {
            // The delay is used to simulate work my the interceptor, thereof not always continuing on the same thread.
            var interceptor = new TestAsyncInterceptorBase(_log, msDelay);

            _proxy = ProxyGen.CreateProxy(_log, interceptor);
        }
Esempio n. 2
0
        public WhenProcessingSynchronousResultMethods(ITestOutputHelper output)
        {
            string randomValue = "randomValue_" + Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);

            _log         = new ListLogger(output);
            _interceptor = new TestProcessingAsyncInterceptor(_log, randomValue);
            _proxy       = ProxyGen.CreateProxy(_log, _interceptor);
        }
Esempio n. 3
0
        protected WhenInterceptingAsynchronousResultMethodsBase(
            ITestOutputHelper output,
            bool asyncB4Proceed,
            int msDelayAfterProceed)
        {
            _log = new ListLogger(output);

            // The delay is used to simulate work my the interceptor, thereof not always continuing on the same thread.
            var interceptor = new TestAsyncInterceptorBase(_log, asyncB4Proceed, msDelayAfterProceed);

            _proxy = ProxyGen.CreateProxy(_log, interceptor);
        }
Esempio n. 4
0
        protected TimingAsynchronousResultMethodCompletedAndIncompleteBase(ITestOutputHelper output, bool alwaysCompleted)
        {
            _log = new ListLogger(output);

            IInterfaceToProxy AlwaysCompletedFactory() => new ClassWithAlwaysCompletedAsync(_log);
            IInterfaceToProxy AlwaysIncompleteFactory() => new ClassWithAlwaysIncompleteAsync(_log);

            _interceptor = new TestAsyncTimingInterceptor(_log);
            _proxy       = ProxyGen.CreateProxy(
                alwaysCompleted ? AlwaysCompletedFactory : (Func <IInterfaceToProxy>)AlwaysIncompleteFactory,
                _interceptor);
        }
Esempio n. 5
0
        protected AsynchronousResultMethodCompletedAndIncompleteBase(ITestOutputHelper output, bool alwaysCompleted)
        {
            _log = new ListLogger(output);

            IInterfaceToProxy AlwaysCompletedFactory() => new ClassWithAlwaysCompletedAsync(_log);
            IInterfaceToProxy AlwaysIncompleteFactory() => new ClassWithAlwaysIncompleteAsync(_log);

            var interceptor = new TestAsyncInterceptorBase(_log, asyncB4Proceed: true, msDelayAfterProceed: 10);

            _proxy = ProxyGen.CreateProxy(
                alwaysCompleted ? AlwaysCompletedFactory : (Func <IInterfaceToProxy>)AlwaysIncompleteFactory,
                interceptor);
        }
 public WhenProcessingSynchronousVoidMethods(ITestOutputHelper output)
 {
     _log         = new ListLogger(output);
     _interceptor = new TestProcessingAsyncInterceptor(_log, "randomValue_" + Guid.NewGuid().ToString("N"));
     _proxy       = ProxyGen.CreateProxy(_log, _interceptor);
 }
Esempio n. 7
0
 public WhenProcessingSynchronousResultMethodsWithTheReturnValue(ITestOutputHelper output)
 {
     _log         = new ListLogger(output);
     _interceptor = new TestProcessingReturnValueAsyncInterceptor(_log);
     _proxy       = ProxyGen.CreateProxy(_log, _interceptor);
 }
 public WhenProcessingSynchronousResultMethodsWithTheReturnValue()
 {
     _interceptor = new TestProcessingReturnValueAsyncInterceptor(_log);
     _proxy       = ProxyGen.CreateProxy(_log, _interceptor);
 }
 public WhenInterceptingSynchronousVoidMethods(ITestOutputHelper output)
 {
     _log   = new ListLogger(output);
     _proxy = ProxyGen.CreateProxy(_log, new TestAsyncInterceptor(_log));
 }
 public WhenTimingSynchronousResultMethods(ITestOutputHelper output)
 {
     _log         = new ListLogger(output);
     _interceptor = new TestAsyncTimingInterceptor(_log);
     _proxy       = ProxyGen.CreateProxy(_log, _interceptor);
 }
 public WhenInterceptingSynchronousResultMethods()
 {
     _proxy = ProxyGen.CreateProxy(_log, new TestAsyncInterceptor(_log));
 }
Esempio n. 12
0
 public WhenInterceptingAsynchronousResultMethods(ITestOutputHelper output)
 {
     _log   = new ListLogger(output);
     _proxy = ProxyGen.CreateProxy(_log, new TestAsyncInterceptor(_log));
     _proxyWithAwaitBefore = ProxyGen.CreateProxy(_log, new TestAsyncInterceptorWithAwaitBefore(_log, 200));
 }
Esempio n. 13
0
 public WhenTimingSynchronousResultMethods()
 {
     _interceptor = new TestAsyncTimingInterceptor(_log);
     _proxy       = ProxyGen.CreateProxy(_log, _interceptor);
 }
 public WhenProcessingSynchronousResultMethods()
 {
     _interceptor = new TestProcessingAsyncInterceptor(_log, "randomValue_" + Guid.NewGuid().ToString("N"));
     _proxy       = ProxyGen.CreateProxy(_log, _interceptor);
 }