コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public Runner(FeatureWithStartupTaskWhichIsDisposable parentFeature)
 {
     this.parentFeature = parentFeature;
 }