public void TestCtor()
        {
            var scheduler = new SerialTaskScheduler(logExceptions: true);

            scheduler.Dispose();
            scheduler.Exceptions.Should().BeEmpty();
        }
        public void TestScheduleOneTask()
        {
            var scheduler = new SerialTaskScheduler(logExceptions: true);
            var task      = scheduler.QueueTask(() => 42);

            task.Wait(TimeSpan.FromSeconds(10)).Should().BeTrue();
            task.Result.Should().Be(42);
            scheduler.Dispose();
            scheduler.Exceptions.Should().BeEmpty();
        }
Exemple #3
0
 public void Dispose()
 {
     _database?.Dispose();
     _scheduler.Dispose();
 }