Exemplo n.º 1
0
        public void CopyConfigToAppSettingsDoesNotUpdateValuesForKeysThatDoNotAlreadyExist()
        {
            var asi = new AppSettingsInitializer(_config, _webConfigReader);

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

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

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