public void NoSpecificRegion_ChangesInSettings_ErrorsInProfiles_ErrorsInAppSettings__NoUserInteraction_CallsIsDoneWithSuccess() { SetCurrentRegion("No Specific Region"); _settingsChanged.HaveChanged().Returns(true); SetErrorsInAppSettings(); //Should be ignored SetErrorsInProfiles(); //Should be ignored _command.Execute(null); Assert.IsTrue(_commandTester.IsDoneWasRaised); Assert.AreEqual(ResponseStatus.Success, _commandTester.LastResponseStatus); _interactionRequest.AssertWasNotRaised <MessageInteraction>(); }
public SettingsCheckResult CheckSettings() { var resultDict = _profileChecker.CheckProfileList(_profilesProvider.Settings, _accountsProvider.Settings); var settingsChanged = _settingsChanged.HaveChanged(); return(new SettingsCheckResult(resultDict, settingsChanged)); }
public override void Execute(object obj) { var currentRegion = _regionHelper.CurrentRegionName; MessageInteraction interaction = null; if (currentRegion == MainRegionViewNames.SettingsView) { var currentSettings = _currentSettingsProvider.Settings; var result = _appSettingsChecker.CheckDefaultViewers(currentSettings.ApplicationSettings); var resultDict = new ActionResultDict(); resultDict.Add(Translation.DefaultViewer, result); interaction = DetermineInteraction(resultDict, settingsChanged: false); } else if (currentRegion == MainRegionViewNames.ProfilesView) { var currentSettings = _currentSettingsProvider.Settings; var resultDict = _profileChecker.CheckProfileList(currentSettings.ConversionProfiles, currentSettings.ApplicationSettings.Accounts); var settingsChanged = _settingsChanged.HaveChanged(); interaction = DetermineInteraction(resultDict, settingsChanged); } if (interaction != null) { _interactionRequest.Raise(interaction, ResolveInteractionResult); } else { IsDone?.Invoke(this, new MacroCommandIsDoneEventArgs(ResponseStatus.Success)); } }
public void Execute(object parameter) { if (_settingsChanged.HaveChanged()) { _currentSettingsProvider.StoreCurrentSettings(); _settingsManager.SaveCurrentSettings(); } }
public void Execute(object parameter) { if (_settingsChanged.HaveChanged()) { _settingsProvider.UpdateSettings(_currentSettingsProvider.Settings); _settingsLoader.SaveSettingsInRegistry(_currentSettingsProvider.Settings); } }
public void Execute(object parameter) { if (!_settingsChanged.HaveChanged()) { _logger.Trace("Settings have not changed, skip saving."); return; } _logger.Trace("Storing and saving current settings"); _currentSettingsProvider.StoreCurrentSettings(); _settingsManager.SaveCurrentSettings(); }