Ejemplo n.º 1
0
        public bool StaticAppSettingsTest(string value)
        {
            var n = new NameValueCollection {
                { "features.FeatureA", value }
            };
            var featureStore = new CachingFeatureStore(new AppSettingsFeatureStore(n));

            return(featureStore.GetFeature("FeatureA").IsActive());
        }
Ejemplo n.º 2
0
        public void DynamicAppSettingsTest()
        {
            var n = new NameValueCollection();

            n.Add("features.FeatureA", "true");

            var featureStore = new CachingFeatureStore(new AppSettingsFeatureStore("features.", n, true));

            Assert.IsTrue(featureStore.GetFeature("FeatureA").IsActive());

            n["features.FeatureA"] = "false";

            Assert.IsFalse(featureStore.GetFeature("FeatureA").IsActive());
        }