コード例 #1
0
 public SqlInstancesVm(ISqlServerUtil util,
                       IProgressBarProvider progressBarProvider, IUserPreferencePersist userPreference)
 {
     Instances            = new ObservableCollection <string>();
     DbNames              = new ObservableCollection <string>();
     _util                = util;
     _ProgressBarProvider = progressBarProvider;
     _userPreference      = userPreference;
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 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);
         }
     };
 }
コード例 #4
0
 public void Setup()
 {
     _progressBarProvider = Substitute.For <IProgressBarProvider>();
     _userPrefPersist     = Substitute.For <IUserPreferencePersist>();
     _userPrefPersist.LoadPreference().Returns(new UserPreference());
 }