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);
        }
        public void ReadBooleanTrue()
        {
            var result = false;

            var sut = new ApplicationResourcesSettingsProvider();

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

            Assert.IsTrue(result);
        }
コード例 #3
0
        protected EnabledOnOrBeforeDateFeatureToggle()
        {
            NowProvider = () => DateTime.Now;
#if (WINDOWS_PHONE || NETFX_CORE)

            ToggleValueProvider = new ApplicationResourcesSettingsProvider();
#else

            ToggleValueProvider = new AppSettingsProvider();
#endif
        }
        public EnabledOnOrAfterAssemblyVersionWhereToggleIsDefinedToggle()
        {
#if (WINDOWS_PHONE || NETFX_CORE)

            ToggleValueProvider = new ApplicationResourcesSettingsProvider();

#else

            ToggleValueProvider = new AppSettingsProvider();
#endif
        }
コード例 #5
0
        protected SimpleFeatureToggle()
        {
            #if (WINDOWS_PHONE || NETFX_CORE)

            ToggleValueProvider = new ApplicationResourcesSettingsProvider();

            #else

            ToggleValueProvider = new AppSettingsProvider();
            #endif
        }
        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);
        }
    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);
        }
        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);
        }
    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);
        }
    public void ReadDatePeriod()
#endif        
        {
            var result = Tuple.Create(DateTime.MinValue, DateTime.MaxValue);

            var sut = new ApplicationResourcesSettingsProvider();

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

            AssertFacade.Equal(new DateTime(2000, 1, 1, 23, 22, 21), result.Item1);
            AssertFacade.Equal(new DateTime(2001, 1, 1, 23, 22, 21), result.Item2);
        }
    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);
        }