public async Task LoadSqlInstanceAndDbs() { await SqlInstancesVm.RetrieveInstanceAsync(); await SqlInstancesVm.RetrieveDbNamesAsync(SqlInstancesVm.SelectedInst); var pref = _userPreferencePersist.LoadPreference(); DbRestorOptVm.TargetDbName = pref.LastUsedDbName; }
public void Setup() { _sqlServerUtil = Substitute.For <ISqlServerUtil>(); _sqlServerUtil.GetSqlInstances().Returns(Instances); _progressBarProvider = Substitute.For <IProgressBarProvider>(); _userPrefPersist = Substitute.For <IUserPreferencePersist>(); _userPrefPersist.LoadPreference().Returns(new UserPreference()); _vm = new SqlInstancesVm(_sqlServerUtil, _progressBarProvider, _userPrefPersist); }
public MainWindowVm(ISqlServerUtil sqlserverUtil, IUserPreferencePersist userPreferencePersist) { _sqlserverUtil = sqlserverUtil; _userPreferencePersist = userPreferencePersist; SqlInstancesVm = new SqlInstancesVm(_sqlserverUtil, this, userPreferencePersist); _DbRestoreOption.PropertyChanged += (sender, args) => { if (args.PropertyName == nameof(DbRestorOptVm.TargetDbName)) { var pref = _userPreferencePersist.LoadPreference(); pref.LastUsedDbName = _DbRestoreOption.TargetDbName; _userPreferencePersist.SavePreference(pref); } }; }
public void Setup() { _progressBarProvider = Substitute.For <IProgressBarProvider>(); _userPrefPersist = Substitute.For <IUserPreferencePersist>(); _userPrefPersist.LoadPreference().Returns(new UserPreference()); }