Example #1
0
        public void AppSettingsLoader_Load_NoExceptionIfHasOptionalSettingOnClass()
        {
            var mockSettingsLoader = new SettingLoaderMock();

            var settings = new SettingsOptionalClass();

            AppSettingsLoader.Load(mockSettingsLoader, ref settings);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
        public void AppSettingsLoader_Load_NoExceptionIfHasOptionalSettingOnClass()
        {
            var mockSettingsLoader = new SettingLoaderMock();

            var settings = new SettingsOptionalClass();

            AppSettingsLoader.Load(mockSettingsLoader, ref settings);
        }