Exemple #1
0
        public void CopyConfigToAppSettingsDoesNotUpdateValuesForKeysThatDoNotAlreadyExist()
        {
            var asi = new AppSettingsInitializer(_config, _webConfigReader);

            asi.CopyConfigToAppSettings(_webConfigWriter);
            _webConfigWriter.DidNotReceive().SetAppSetting("app_setting_3", "new_value_3");
        }
Exemple #2
0
        public void CopyConfigToAppSettingsUpdatesValuesFromConfig()
        {
            var asi = new AppSettingsInitializer(_config, _webConfigReader);

            asi.CopyConfigToAppSettings(_webConfigWriter);
            _webConfigWriter.Received().SetAppSetting("app_setting_2", "new_value_2");
        }
Exemple #3
0
        public void CopyConfigToAppSettingsThrowsWhenWebConfigWriterIsNull()
        {
            var asi = new AppSettingsInitializer(_config, _webConfigReader);

            Assert.Throws <ArgumentNullException>(() => asi.CopyConfigToAppSettings(null));
        }