public void DisposeWithTimerStoppedShouldDisposeInternalTimer() { const ScheduledTimerStatus expected = ScheduledTimerStatus.Stopped; var sut = new ScheduledTimer(); var disposed = false; sut.TimerObject.Disposed += ((sender, args) => disposed = true); sut.Dispose(); Assert.That(sut.Status, Is.EqualTo(expected)); Assert.That(disposed, Is.True); }
public override void Dispose() { _timer?.Dispose(); base.Dispose(); }