public void Dispose_DisposesSocketAndTimer() { // Arrange _mockTimerFactory.Setup(x => x.CreateTimer()).Returns(_mockTimer.Object); _target.Run(); // Act _target.Dispose(); // Assert _mockUdpSocket.Verify(x => x.Dispose()); _mockTimer.Verify(x => x.Dispose()); }
private void DisposeNavDataWorker() { if (NavDataWorker != null) { NavDataWorker.Dispose(); NavDataWorker = null; } }
protected override void DisposeOverride() { if (_InputTimer != null) { _InputTimer.Cancel(); } if (_WatchdogWorker != null) { _WatchdogWorker.Dispose(); } if (_ConfigurationWorker != null) { _ConfigurationWorker.Dispose(); } if (_NavDataWorker != null) { _NavDataWorker.Dispose(); } if (_CommandWorker != null) { _CommandWorker.Dispose(); } }