コード例 #1
0
        public void OperationCanceledException_DoesNotCauseAutomaticRetry()
        {
            var component = new WaitingComponent();
            var supervisor = new ServerSupervisor(component, _options);
            supervisor.Start();

            Thread.Sleep(500);
            supervisor.Dispose();

            Assert.Equal(1, component.CalledTimes);
        }
コード例 #2
0
        public void Dispose_ShouldDisposeDisposableComponent()
        {
            // Arrange
            _options.MaxRetryAttempts = 0;

            var component = new DisposableComponent();
            var supervisor = new ServerSupervisor(component, _options);

            supervisor.Start();
            Thread.Sleep(100);

            // Act
            supervisor.Dispose();
            Thread.Sleep(500);

            // Assert
            Assert.True(component.Disposed);
        }