コード例 #1
0
        public void CopyConfigToAppSettingsDoesNotUpdateValuesForKeysThatDoNotAlreadyExist()
        {
            var asi = new AppSettingsInitializer(_config, _webConfigReader);

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

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

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