Esempio n. 1
0
        public static void SetupForSystem()
        {
            Core.Utils.SetupResourceDictionary();
            var shell          = GetMockShellVm(true, localhostString);
            var shellViewModel = GetMockShellVm(false, destinationServerString);
            // ReSharper disable once UseObjectOrCollectionInitializer
            var dest = new DeployDestinationViewModelForTesting(shellViewModel, GetMockAggegator());

            dest.ConnectControlViewModel.SelectedConnection = shellViewModel.ActiveServer;
            ScenarioContext.Current.Add(connectControlString, dest.ConnectControlViewModel.SelectedConnection);

            ScenarioContext.Current[destinationString] = dest;
            var stats = new DeployStatsViewerViewModel(dest);
            var src   = new DeploySourceExplorerViewModelForTesting(shell, GetMockAggegator(), GetStatsVm(dest))
            {
                Children = new List <IExplorerItemViewModel> {
                    CreateExplorerVms()
                }
            };

            ScenarioContext.Current["Src"] = src;
            var popupController = GetPopup().Object;
            var vm = new SingleExplorerDeployViewModel(dest, src, new List <IExplorerTreeItem>(), stats, shell, popupController);

            ScenarioContext.Current[viewModelString] = vm;
            ScenarioContext.Current[statsString]     = stats;
        }
Esempio n. 2
0
        public void Cleanup()
        {
            var shell = GetMockShellVm(true, localhostString);
            var dest  = new DeployDestinationViewModelForTesting(GetMockShellVm(false, destinationServerString), GetMockAggegator());

            ScenarioContext.Current[destinationString] = dest;
            var stats = new DeployStatsViewerViewModel(dest);
            var src   = new DeploySourceExplorerViewModelForTesting(shell, GetMockAggegator(), GetStatsVm(dest));

            ScenarioContext.Current["Src"] = src;
            var vm = new SingleExplorerDeployViewModel(dest, src, new List <IExplorerTreeItem>(), stats, shell, GetPopup().Object);

            vm.Destination.SelectedEnvironment.Children = new ObservableCollection <IExplorerItemViewModel>();
            ScenarioContext.Current[viewModelString]    = vm;
            GetPopup().Setup(a => a.ShowDeployConflict(It.IsAny <int>()));
            GetPopup().Setup(a => a.ShowDeployNameConflict(It.IsAny <string>()));
            vm.PopupController = GetPopup().Object;
            _deployed          = false;
        }
Esempio n. 3
0
        public static void SetupForSystem()
        {
            Core.Utils.SetupResourceDictionary();
            var serverRepo = new Mock <IServerRepository>();
            var connectControlSingleton = new Mock <IConnectControlSingleton>();

            CustomContainer.Register(connectControlSingleton.Object);

            var explorerTooltips = new Mock <IExplorerTooltips>();

            CustomContainer.Register(explorerTooltips.Object);

            var shell          = GetMockShellVm(true, localhostString);
            var shellViewModel = GetMockShellVm(false, destinationServerString);

            serverRepo.Setup(repository => repository.ActiveServer).Returns(shellViewModel.ActiveServer);
            serverRepo.Setup(repository => repository.Source).Returns(shellViewModel.ActiveServer);
            serverRepo.Setup(repository => repository.All()).Returns(new List <IServer>()
            {
                shellViewModel.ActiveServer
            });
            serverRepo.Setup(repository => repository.Get(It.IsAny <Guid>())).Returns(shellViewModel.ActiveServer);
            CustomContainer.Register(serverRepo.Object);
            var dest = new DeployDestinationViewModelForTesting(shellViewModel, GetMockAggegator())
            {
                ConnectControlViewModel = { SelectedConnection = shellViewModel.ActiveServer }
            };

            ScenarioContext.Current.Add(connectControlString, dest.ConnectControlViewModel.SelectedConnection);

            ScenarioContext.Current[destinationString] = dest;
            var stats = new DeployStatsViewerViewModel(dest);
            var src   = new DeploySourceExplorerViewModelForTesting(shell, GetMockAggegator(), GetStatsVm(dest));

            ScenarioContext.Current["Src"] = src;
            var popupController = GetPopup().Object;
            var vm = new SingleExplorerDeployViewModel(dest, src, new List <IExplorerTreeItem>(), stats, shell, popupController, new SynchronousAsyncWorker());

            ScenarioContext.Current[viewModelString] = vm;
            ScenarioContext.Current[statsString]     = stats;
        }