public void GetSettingValueRaisesExceptionWithMissingSection()
        {
            // --- Arrange
            const string KEY = "missingSection";
            var provider = new AppConfigProvider();

            // --- Act
            provider.GetSetting<AppConfigurationSettings>(KEY);
        }
示例#2
0
        public void GetSettingValueRaisesExceptionWithMissingSection()
        {
            // --- Arrange
            const string KEY      = "missingSection";
            var          provider = new AppConfigProvider();

            // --- Act
            provider.GetSetting <AppConfigurationSettings>(KEY);
        }
示例#3
0
    private string GetConfigValueOrThrow(string configKey)
    {
        string value = provider.GetSetting(configKey);

        if (value == null)
        {
            throw new Exception($"A value for key {configKey} is missing in the App.config file.");
        }

        return(value);
    }