Example #1
0
        public FeatureConfig()
        {
            this.config = new Configuration();

            Features features = ReadConfigFeatures();

            foreach (ConfigFeature featureConfig in features.Feature)
            {
                Feature feature = new Feature(featureConfig.Name, new OnStrategy(), featureConfig.StartDate, featureConfig.EndDate);
                this.config.AddFeature(feature);
            }

            //Feature feature = new Feature("Fred", new OnStrategy(), null, DateTime.Parse("25/9/2015"));
        }
Example #2
0
        static void Main(string[] args)
        {
            Configuration config = new Configuration();
            Feature onFeature = SetUpOnFeature();
            config.AddFeature(onFeature);
            Feature oldEndDateFeature = SetUpOnFeatureWithEndDateInPast();
            config.AddFeature(oldEndDateFeature);
            IDirector director = new Director(config);
            Console.WriteLine(director.IsEnabled(ON_FEATURE_NAME));
            Console.WriteLine(director.IsEnabled(OUT_OF_DATE));
            Console.WriteLine(director.IsAnyFeatureEnabled());
            Console.WriteLine(director.AreAllFeaturesEnabled());

            Console.ReadLine();
        }
Example #3
0
 public Director(Configuration config)
 {
     this.config = config;
 }