public void IsEnabled_Feature2()
        {
            var target = new FeatureSwitch();
            target.ParseFeatureSwitches(collection);

            Assert.IsTrue((target as IFeatureSwitch)["Feature2"]);
        }
        public void IsEnabled_SubFeature3()
        {
            var target = new FeatureSwitch();

            target.ParseFeatureSwitches(collection);

            Assert.IsFalse((target as IFeatureSwitch)["Feature2.SubFeature2.SubFeature3"]);
        }
        public void IsEnabled_Feature2()
        {
            var target = new FeatureSwitch();

            target.ParseFeatureSwitches(collection);

            Assert.IsTrue((target as IFeatureSwitch)["Feature2"]);
        }
        public void ParseFeatureSwitches_NumberOfItems()
        {
            var target = new FeatureSwitch();

            target.ParseFeatureSwitches(collection);

            Assert.AreEqual(5, target.Features.Count);
        }
示例#5
0
        /// <summary>
        ///     Creates an instance of <see href="IFeatureSwitch"/>.
        ///
        ///     The sole parameter is a stream that represents the 
        ///     feature configuration file.
        /// </summary>
        public static IFeatureSwitch Create(System.IO.Stream stream)
        {
            if(stream == null)
                throw new System.ArgumentNullException("stream");

            FeatureSwitch result = new FeatureSwitch();
            result.ParseFeatureSwitches(FeatureModelCollection.Deserialize(stream));
            return result;
        }
示例#6
0
        /// <summary>
        ///     Creates an instance of <see href="IFeatureSwitch"/>.
        ///
        ///     The sole parameter is a stream that represents the
        ///     feature configuration file.
        /// </summary>
        public static IFeatureSwitch Create(System.IO.Stream stream)
        {
            if (stream == null)
            {
                throw new System.ArgumentNullException("stream");
            }

            FeatureSwitch result = new FeatureSwitch();

            result.ParseFeatureSwitches(FeatureModelCollection.Deserialize(stream));
            return(result);
        }
        public void IsEnabled_SubFeature3()
        {
            var target = new FeatureSwitch();
            target.ParseFeatureSwitches(collection);

            Assert.IsFalse((target as IFeatureSwitch)["Feature2.SubFeature2.SubFeature3"]);
        }
        public void ParseFeatureSwitches_NumberOfItems()
        {
            var target = new FeatureSwitch();
            target.ParseFeatureSwitches(collection);

            Assert.AreEqual(5, target.Features.Count);
        }