Esempio n. 1
0
        public EnabledOnOrAfterAssemblyVersionWhereToggleIsDefinedToggle()
        {
#if (WINDOWS_PHONE || NETFX_CORE)
            ToggleValueProvider = new ApplicationResourcesSettingsProvider();
#else
            ToggleValueProvider = new AppSettingsProvider();
#endif
        }
        protected SimpleFeatureToggle()
        {
#if (WINDOWS_PHONE || NETFX_CORE)
            ToggleValueProvider = new ApplicationResourcesSettingsProvider();
#else
            ToggleValueProvider = new AppSettingsProvider();
#endif
        }
Esempio n. 3
0
        protected SimpleFeatureToggle()
        {
#if WINDOWS_UWP
            ToggleValueProvider = new ApplicationResourcesSettingsProvider();
#else
            ToggleValueProvider = new AppSettingsProvider();
#endif
        }
Esempio n. 4
0
        protected EnabledOnDaysOfWeekFeatureToggle()
        {
            NowProvider = () => DateTime.Now;
#if WINDOWS_UWP
            ToggleValueProvider = new ApplicationResourcesSettingsProvider();
#else
            ToggleValueProvider = new AppSettingsProvider();
#endif
        }
        protected EnabledOnOrBeforeDateFeatureToggle()
        {
            NowProvider = () => DateTime.Now;
#if (WINDOWS_PHONE || NETFX_CORE)
            ToggleValueProvider = new ApplicationResourcesSettingsProvider();
#else
            ToggleValueProvider = new AppSettingsProvider();
#endif
        }
Esempio n. 6
0
        public void ReadDate()
        {
            var result = DateTime.MaxValue;

            var sut = new ApplicationResourcesSettingsProvider();

            RunOn.Dispatcher(() => { result = sut.EvaluateDateTimeToggleValue(new SimpleToggle()); });

            Assert.AreEqual(new DateTime(2000, 1, 1, 23, 22, 21), result);
        }
Esempio n. 7
0
        public void ReadBooleanFalse()
        {
            var result = true;

            var sut = new ApplicationResourcesSettingsProvider();

            RunOn.Dispatcher(() => { result = sut.EvaluateBooleanToggleValue(new BooleanFalse()); });

            Assert.IsFalse(result);
        }
Esempio n. 8
0
        public void ReadDatePeriod()
        {
            var result = Tuple.Create(DateTime.MinValue, DateTime.MaxValue);

            var sut = new ApplicationResourcesSettingsProvider();

            RunOn.Dispatcher(() => { result = sut.EvaluateTimePeriod(new PeriodToggle()); });

            Assert.AreEqual(new DateTime(2000, 1, 1, 23, 22, 21), result.Item1);
            Assert.AreEqual(new DateTime(2001, 1, 1, 23, 22, 21), result.Item2);
        }
Esempio n. 9
0
        public void ReadDaysOfWeek()
        {
            List <DayOfWeek> result = null;

            var sut = new ApplicationResourcesSettingsProvider();

            RunOn.Dispatcher(() => { result = sut.GetDaysOfWeek(new DaysToggle()).ToList(); });

            Assert.AreEqual(DayOfWeek.Wednesday, result[0]);
            Assert.AreEqual(DayOfWeek.Saturday, result[1]);
            Assert.AreEqual(2, result.Count);
        }
Esempio n. 10
0
        public async Task ReadDatePeriod()
        {
            var result = Tuple.Create(DateTime.MinValue, DateTime.MaxValue);

            var sut = new ApplicationResourcesSettingsProvider();

            await RunOn.Dispatcher(() =>
            {
                ApplicationResourcesSetter.Set("FeatureToggle.PeriodToggle", "01-Jan-2000 23:22:21 | 01-Jan-2001 23:22:21");
                result = sut.EvaluateTimePeriod(new PeriodToggle());
            });

            Assert.Equal(new DateTime(2000, 1, 1, 23, 22, 21), result.Item1);
            Assert.Equal(new DateTime(2001, 1, 1, 23, 22, 21), result.Item2);
        }
Esempio n. 11
0
        public async Task ReadDate()

        {
            var result = DateTime.MaxValue;

            var sut = new ApplicationResourcesSettingsProvider();

            await RunOn.Dispatcher(() =>
            {
                ApplicationResourcesSetter.Set("FeatureToggle.SimpleToggle", "01-Feb-2000 23:22:21");
                result = sut.EvaluateDateTimeToggleValue(new SimpleToggle());
            });

            Assert.Equal(new DateTime(2000, 2, 1, 23, 22, 21), result);
        }
Esempio n. 12
0
        public async Task ReadBooleanFalse()

        {
            var result = true;

            var sut = new ApplicationResourcesSettingsProvider();

            await RunOn.Dispatcher(() =>
            {
                ApplicationResourcesSetter.Set("FeatureToggle.BooleanFalse", false);
                result = sut.EvaluateBooleanToggleValue(new BooleanFalse());
            });


            Assert.False(result);
        }
Esempio n. 13
0
        public async Task ReadDaysOfWeek()
        {
            List <DayOfWeek> result = null;

            var sut = new ApplicationResourcesSettingsProvider();

            await RunOn.Dispatcher(() =>
            {
                ApplicationResourcesSetter.Set("FeatureToggle.DaysToggle", "Wednesday, Saturday");
                result = sut.GetDaysOfWeek(new DaysToggle()).ToList();
            });

            Assert.Equal(DayOfWeek.Wednesday, result[0]);
            Assert.Equal(DayOfWeek.Saturday, result[1]);
            Assert.Equal(2, result.Count);
        }
Esempio n. 14
0
        public void ReadDate()
#endif
        {
            var result = DateTime.MaxValue;

            var sut = new ApplicationResourcesSettingsProvider();

#if NETFX_CORE
            await
#endif
            RunOn.Dispatcher(() =>
            {
                ApplicationResourcesSetter.Set("FeatureToggle.SimpleToggle", "01-Feb-2000 23:22:21");
                result = sut.EvaluateDateTimeToggleValue(new SimpleToggle());
            });

            AssertFacade.Equal(new DateTime(2000, 2, 1, 23, 22, 21), result);
        }
Esempio n. 15
0
        public void ReadBooleanFalse()
#endif
        {
            var result = true;

            var sut = new ApplicationResourcesSettingsProvider();

#if NETFX_CORE
            await
#endif
            RunOn.Dispatcher(() =>
            {
                ApplicationResourcesSetter.Set("FeatureToggle.BooleanFalse", false);
                result = sut.EvaluateBooleanToggleValue(new BooleanFalse());
            });


            AssertFacade.False(result);
        }
Esempio n. 16
0
        public void ReadDaysOfWeek()
#endif
        {
            List <DayOfWeek> result = null;

            var sut = new ApplicationResourcesSettingsProvider();

#if NETFX_CORE
            await
#endif
            RunOn.Dispatcher(() =>
            {
                ApplicationResourcesSetter.Set("FeatureToggle.DaysToggle", "Wednesday, Saturday");
                result = sut.GetDaysOfWeek(new DaysToggle()).ToList();
            });

            AssertFacade.Equal(DayOfWeek.Wednesday, result[0]);
            AssertFacade.Equal(DayOfWeek.Saturday, result[1]);
            AssertFacade.Equal(2, result.Count);
        }