public void AppSettingsLoader_Load_NoExceptionIfHasOptionalSettingOnClass() { var mockSettingsLoader = new SettingLoaderMock(); var settings = new SettingsOptionalClass(); AppSettingsLoader.Load(mockSettingsLoader, ref settings); }
public void AppSettings_Load_NoDevSettingPresentLoadsAsNormal() { string settingName = "OptionalSetting"; string prodSetting = "prod"; var devLoader = new SettingLoaderMock(); var prodLoader = new SettingLoaderMock(); prodLoader.Settings.Add(settingName, prodSetting); var settings = new SettingsOptionalClass(); AppSettingsLoader.DevSettings = devLoader; Assert.IsTrue(AppSettingsLoader.Load(prodLoader, ref settings), "Load returned false"); Assert.AreEqual(prodSetting, settings.OptionalSetting); }
public void AppSettings_Load_DevSettingOverrides() { string settingName = "OptionalSetting"; string devSetting = "dev"; var devLoader = new SettingLoaderMock(); devLoader.Settings.Add(settingName, devSetting); var prodLoader = new SettingLoaderMock(); prodLoader.Settings.Add(settingName, "prod"); var settings = new SettingsOptionalClass(); AppSettingsLoader.DevSettings = devLoader; Assert.IsTrue(AppSettingsLoader.Load(prodLoader, ref settings), "Load returned false"); Assert.AreEqual(devSetting, settings.OptionalSetting); }
public void AppSettings_Load_NoDevSettingPresentLoadsAsNormal() { string settingName = "OptionalSetting"; string prodSetting = "prod"; var devLoader = new SettingLoaderMock(); var prodLoader = new SettingLoaderMock(); prodLoader.Settings.Add(settingName, prodSetting); var settings = new SettingsOptionalClass(); AppSettingsLoader.DevSettings = devLoader; Assert.IsTrue(AppSettingsLoader.Load(prodLoader, ref settings), "Load returned false"); Assert.AreEqual(prodSetting, settings.OptionalSetting); }
public void AppSettings_Load_DevSettingOverrides() { string settingName = "OptionalSetting"; string devSetting = "dev"; var devLoader = new SettingLoaderMock(); devLoader.Settings.Add(settingName, devSetting); var prodLoader = new SettingLoaderMock(); prodLoader.Settings.Add(settingName, "prod"); var settings = new SettingsOptionalClass(); AppSettingsLoader.DevSettings = devLoader; Assert.IsTrue(AppSettingsLoader.Load(prodLoader, ref settings), "Load returned false"); Assert.AreEqual(devSetting, settings.OptionalSetting); }
public void AppSettingsLoader_Load_NoExceptionIfHasOptionalSettingOnClass() { var mockSettingsLoader = new SettingLoaderMock(); var settings = new SettingsOptionalClass(); AppSettingsLoader.Load(mockSettingsLoader, ref settings); }