Exemplo n.º 1
0
        public CommonTest()
        {
            _params                 = new TestParams();
            _createChannelStats     = new CallStats(_params.SunnyDayMaxStatsSamples, _params.RainyDayMaxStatsSamples, _params.ExceptionHandler);
            _useChannelStats        = new CallStats(_params.SunnyDayMaxStatsSamples, _params.RainyDayMaxStatsSamples, _params.ExceptionHandler);
            _useChannelAsyncStats   = new CallStats(_params.SunnyDayMaxStatsSamples, _params.RainyDayMaxStatsSamples, _params.ExceptionHandler);
            _closeChannelStats      = new CallStats(_params.SunnyDayMaxStatsSamples, _params.RainyDayMaxStatsSamples, _params.ExceptionHandler);
            _closeChannelAsyncStats = new CallStats(_params.SunnyDayMaxStatsSamples, _params.RainyDayMaxStatsSamples, _params.ExceptionHandler);
            _closeFactoryStats      = new CallStats(_params.SunnyDayMaxStatsSamples, _params.RainyDayMaxStatsSamples, _params.ExceptionHandler);
            _closeFactoryAsyncStats = new CallStats(_params.SunnyDayMaxStatsSamples, _params.RainyDayMaxStatsSamples, _params.ExceptionHandler);
            _openChannelStats       = new CallStats(_params.SunnyDayMaxStatsSamples, _params.RainyDayMaxStatsSamples, _params.ExceptionHandler);
            _openChannelAsyncStats  = new CallStats(_params.SunnyDayMaxStatsSamples, _params.RainyDayMaxStatsSamples, _params.ExceptionHandler);

            // Figure out the service calls timeout value
            int timeoutMs = TestHelpers.SendTimeoutMs;

            if (timeoutMs <= 0)
            {
                // If the timeout was not set then one alternative (to just using the usual default timeout)
                // would be to wait for a binding to be created and then getting its timeout and only then initialize _timeoutTracker.
                // This involves some additional synchronization which we want to avoid here.
                timeoutMs = 60000;
            }
            _timeoutTracker = new OperationTimeoutTracker <ChannelType>(timeoutMs, ReportTimeout);
        }