public void FromEnvironmentProviderTest_NullRetrieval() { var fromEnvironmentProvider = new FromEnvironmentProvider(); Environment.SetEnvironmentVariable("ExistingKey", "ExistingKeyValue"); var nullKeyValue = fromEnvironmentProvider.GetRawSetting(null); }
public void FromEnvironmentProviderTest_NonExistingRetrieval() { var fromEnvironmentProvider = new FromEnvironmentProvider(); Environment.SetEnvironmentVariable("ExistingKey", "ExistingKeyValue"); var notExistingKeyValue = fromEnvironmentProvider.GetRawSetting("NotExistingKey"); Assert.IsNull(notExistingKeyValue, "Not existing key value is not null!"); }
public void FromEnvironmentProviderTest_SimpleRetrieval() { var fromEnvironmentProvider = new FromEnvironmentProvider(); Environment.SetEnvironmentVariable("ExistingKey", "ExistingKeyValue"); var existingKeyValue = fromEnvironmentProvider.GetRawSetting("ExistingKey"); Assert.AreEqual("ExistingKeyValue", existingKeyValue); }
private static SettingsFiller GetAdvancedSettingsFiller() { var converterChooser = new SettingsConverterChooser(new IRawSettingsConverter[] { new StringToFrameworkTypesConverter(), new SuperConverter() }); var funcSettingsProvider = new FromFuncProvider(key => new C()); var envSettingsProvider = new FromEnvironmentProvider(); var settingsFiller = new SettingsFiller(converterChooser, new Dictionary <string, IRawSettingsProvider> { { "func", funcSettingsProvider }, { "env", envSettingsProvider } }, funcSettingsProvider); return(settingsFiller); }