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 ParseFeatureSwitches_NumberOfItems() { var target = new FeatureSwitch(); target.ParseFeatureSwitches(collection); Assert.AreEqual(5, target.Features.Count); }
/// <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; }
/// <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); }