public void InvalidDayInConfig()
        {
            var sut = new AppSettingsProvider();

            var ex = Assert.Throws <ToggleConfigurationError>(() => sut.GetDaysOfWeek(new InvalidDayToggle()).ToList());

            Assert.Equal("The value 'Sun' in config key 'FeatureToggle.InvalidDayToggle' is not a valid day of the week. Days should be specified in long format. E.g. Friday and not Fri.", ex.Message);
        }
Пример #2
0
        public void ReadDaysTimePeriod()
        {
            IDaysOfWeekToggleValueProvider sut = new AppSettingsProvider();

            var daysFromConfig = sut.GetDaysOfWeek(new MondayAndFridayToggle());

            var expected = new[] { DayOfWeek.Monday, DayOfWeek.Friday };

            Assert.Equal(expected, daysFromConfig);
        }