public void TestDispose2() { SingleDataSource source = new SingleDataSource(_logFileFactory, _scheduler, new DataSource(@"E:\somelogfile.txt") { Id = DataSourceId.CreateNew() }); _scheduler.PeriodicTaskCount.Should().BeGreaterThan(0); source.Dispose(); _scheduler.PeriodicTaskCount.Should().Be(0, "because all tasks should've been removed"); }
public void TestDispose2() { var settings = new DataSource("foo") { Id = DataSourceId.CreateNew() }; var dataSource = new SingleDataSource(_logFileFactory, _taskScheduler, settings); _merged.Add(dataSource); _merged.Remove(dataSource); dataSource.Dispose(); _merged.Dispose(); _taskScheduler.PeriodicTaskCount.Should().Be(0, "because all tasks should've been removed"); }