Example #1
0
        // GET: JsonToggler
        public virtual ActionResult Index()
        {
            var feature1 = new DateFeature();
            var feature2 = new BasicFeature();
            var feature3 = new Filter_Feature();
            var feature4 = new SQLFeature();

            var isEnabled = feature2.IsEnabled();

            var listOfGuids = new List <Guid>();

            listOfGuids.Add(new Guid("00000000-0000-0000-0000-000000000001"));
            listOfGuids.Add(new Guid("00000000-0000-0000-0000-000000000002"));
            listOfGuids.Add(new Guid("00000000-0000-0000-0000-000000000003"));
            listOfGuids.Add(new Guid("00000000-0000-0000-0000-000000000004"));
            listOfGuids.Add(new Guid("00000000-0000-0000-0000-000000000005"));

            var result = feature3.FilterCollection <Guid, Guid>(listOfGuids, "").ToList();

            var listOfObjects = GetListOfSomeObject();
            var result2       = feature3.FilterCollection <SomeObject, Guid>(listOfObjects, "Id").ToList();

            //This will do the opposite of the original filter... This will filter only if the feature is enabled.
            var result3 = feature3.FilterCollection <SomeObject, Guid>(listOfObjects, "Id", true).ToList();

            var vm = new JsonTogglerFeatureViewModel()
            {
                BasicFeature = feature2, SQLFeature = feature4, DateFeature = feature1, Filter_Feature = feature3, OriginalCollection = listOfGuids, UpdatedCollection = result
            };

            return(View(vm));
        }
Example #2
0
        public void Feature_DEVAndroidPlatformIsEnabled_ReturnsFalse()
        {
            var jsonSettings = GetJsonSettings(EnvironmentEnum.LOCAL, PlatformEnum.Android);

            var feature = new BasicFeature(jsonSettings);

            Assert.IsFalse(feature.IsEnabled());
        }
Example #3
0
        public void Feature_PRODWebPlatformIsEnabled_ReturnsFalse()
        {
            var jsonSettings = GetJsonSettings(EnvironmentEnum.PROD, PlatformEnum.Web);

            var feature = new BasicFeature(jsonSettings);

            Assert.IsFalse(feature.IsEnabled());
        }
Example #4
0
        public void Feature_DEVWebPlatformIsEnabled_ReturnsTrue()
        {
            var jsonSettings = GetJsonSettings(EnvironmentEnum.LOCAL, PlatformEnum.Web);

            var feature = new BasicFeature(jsonSettings);

            Assert.IsTrue(feature.IsEnabled());
        }
Example #5
0
        public void Feature_STAGEIsEnabled_ReturnsFalse()
        {
            var jsonSettings = GetJsonSettings(EnvironmentEnum.STAGE);

            var feature = new BasicFeature(jsonSettings);

            Assert.IsFalse(feature.IsEnabled());
        }
Example #6
0
        public void Feature_LOCALIsEnabled_ReturnsTrue()
        {
            var jsonSettings = GetJsonSettings(EnvironmentEnum.LOCAL);

            var feature = new BasicFeature(jsonSettings);

            Assert.IsTrue(feature.IsEnabled());
        }