コード例 #1
0
        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);
        }
コード例 #2
0
 public override void Dispose()
 {
     _timer?.Dispose();
     base.Dispose();
 }