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);
        }
示例#2
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);
        }
示例#3
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);
        }