public SqlInstancesVm(ISqlServerUtil util, IProgressBarProvider progressBarProvider, IUserPreferencePersist userPreference) { Instances = new ObservableCollection <string>(); DbNames = new ObservableCollection <string>(); _util = util; _ProgressBarProvider = progressBarProvider; _userPreference = userPreference; }
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()); }