Exemplo n.º 1
0
        public void Dispose_IsStarted_Exception()
        {
            var p = new Polling(1000, ct => Task.FromResult(false), Mock.Of <ILogger>());

            p.StartPolling();
            p.Dispose();

            Assert.Throws <ObjectDisposedException>(() =>
            {
                var _ = p.IsStarted;
            });
        }
Exemplo n.º 2
0
        /// <inheritdoc />
        public void Stop()
        {
            try
            {
                if (_serviceHealthDependent)
                {
                    _healthCheckingService.DiagnosticFailedEvent -= OnDiagnosticFailed;
                    _healthCheckingService.DiagnosticPassedEvent -= OnDiagnosticPassed;
                }

                _reconnectPolling.Dispose();
                _reconnectPolling = null;
            }
            finally
            {
                Unsubscribe();
            }
        }
Exemplo n.º 3
0
        /// <inheritdoc/>
        public void Stop()
        {
            try
            {
                if (_serviceHealthDependent)
                {
                    _healthCheckingService.DiagnosticFailedEvent -= OnDiagnosticFailed;
                    _healthCheckingService.DiagnosticPassedEvent -= OnDiagnosticPassed;
                }

                _subscribePolling?.Dispose();
                _subscribePolling = null;
            }
            finally
            {
                _adapter.Disconnect();
            }
        }