public async Task Should_dispose_feature_startup_tasks_when_they_implement_IDisposable() { var feature = new FeatureWithStartupTaskWhichIsDisposable(); featureSettings.Add(feature); featureSettings.SetupFeatures(null, null, null); await featureSettings.StartFeatures(null, null); await featureSettings.StopFeatures(null); Assert.True(feature.TaskDisposed); }
public async Task Should_dispose_feature_when_they_implement_IDisposable() { var feature = new FeatureWithStartupTaskWhichIsDisposable(); featureSettings.Add(feature); var builder = new FakeBuilder(typeof(FeatureWithStartupTaskWhichIsDisposable.Runner)); featureSettings.SetupFeatures(null, null); await featureSettings.StartFeatures(builder, null); await featureSettings.StopFeatures(null); Assert.True(FeatureWithStartupTaskWhichIsDisposable.Runner.Disposed); }
public Runner(FeatureWithStartupTaskWhichIsDisposable parentFeature) { this.parentFeature = parentFeature; }