コード例 #1
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);
        }
コード例 #2
0
        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);
        }
コード例 #3
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);
        }