예제 #1
0
        public async Task CanGetSqlInstance()
        {
            Assert.That(_vm.Instances, Is.Empty);

            await _vm.RetrieveInstanceAsync();

            _progressBarProvider.Received(1).Start(false, SqlInstancesVm.RetrivingInstances);
            _progressBarProvider.Received(1).OnCompleted(Arg.Any <string>());

            CollectionAssert.AreEqual(Instances, _vm.Instances);
            Assert.AreEqual(Instances.First(), _vm.SelectedInst);
        }
예제 #2
0
        public async Task ShouldUpdateTheProgressProperly()
        {
            var util = Substitute.For <ISqlServerUtil>();

            util.GetDatabaseNames(Arg.Any <string>()).Returns(DbNames);

            var vm = new SqlInstancesVm(util, _progressBarProvider, _userPrefPersist);

            await vm.RetrieveDbNamesAsync("MSSQLServer");

            _progressBarProvider.Received(1).Start(false, SqlInstancesVm.RetrivingDbNames);
            _progressBarProvider.Received(1).OnCompleted(Arg.Any <string>());
        }