public async Task Should_start_and_stop_features()
        {
            var feature = new FeatureWithStartupTask();

            featureSettings.Add(feature);

            featureSettings.SetupFeatures(new FakeFeatureConfigurationContext());

            await featureSettings.StartFeatures(null, null, default);

            await featureSettings.StopFeatures(default);
Beispiel #2
0
        public async Task Should_start_and_stop_features()
        {
            var feature = new FeatureWithStartupTask();

            featureSettings.Add(feature);

            featureSettings.SetupFeatures(null, null, null);

            await featureSettings.StartFeatures(null, null);

            await featureSettings.StopFeatures(null);

            Assert.True(feature.TaskStarted);
            Assert.True(feature.TaskStopped);
        }
Beispiel #3
0
        public async Task Should_start_and_stop_features()
        {
            var feature = new FeatureWithStartupTask();

            featureSettings.Add(feature);

            var builder = new FakeBuilder(typeof(FeatureWithStartupTask.Runner));

            featureSettings.SetupFeatures(null, null);

            await featureSettings.StartFeatures(builder, null);

            await featureSettings.StopFeatures(null);

            Assert.True(FeatureWithStartupTask.Runner.Started);
            Assert.True(FeatureWithStartupTask.Runner.Stopped);
        }
        public void Should_not_activate_features_with_unmet_dependencies()
        {
            var feature = new FeatureWithStartupTask();

            var featureSettings = new FeatureActivator(new SettingsHolder());

            featureSettings.Add(feature);

            var builder = new FakeBuilder(typeof(FeatureWithStartupTask.Runner));

            featureSettings.SetupFeatures(new FeatureConfigurationContext(null));

            featureSettings.StartFeatures(builder);
            featureSettings.StopFeatures(builder);

            Assert.True(FeatureWithStartupTask.Runner.Started);
            Assert.True(FeatureWithStartupTask.Runner.Stopped);
        }
Beispiel #5
0
 public Runner(FeatureWithStartupTask parentFeature)
 {
     this.parentFeature = parentFeature;
 }