public void DeployViewModel_Ctor_NullParamsFourth_ExprecErrors() { //------------Setup for test-------------------------- var deployViewModel = new SingleExplorerDeployViewModel(new Mock <IDeployDestinationExplorerViewModel>().Object, new Mock <IDeploySourceExplorerViewModel>().Object, new List <IExplorerTreeItem>(), null, new Mock <IShellViewModel>().Object, new Mock <Dev2.Common.Interfaces.Studio.Controller.IPopupController>().Object); //------------Execute Test--------------------------- //------------Assert Results------------------------- }
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; }
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; }
public DeployWorksurfaceViewModel(IEventAggregator eventPublisher, SingleExplorerDeployViewModel vm, IPopupController popupController, IView view) : base(eventPublisher) { ViewModel = vm; View = view; _popupController = popupController; ViewModel.PropertyChanged += (sender, args) => { if (args.PropertyName == "Header") { OnPropertyChanged("DisplayName"); } var mainViewModel = CustomContainer.Get <IShellViewModel>(); if (mainViewModel != null) { ViewModelUtils.RaiseCanExecuteChanged(mainViewModel.SaveCommand); } }; }
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; }
public DeployWorksurfaceViewModel() : base(new EventAggregator()) { var mainViewModel = CustomContainer.Get <IShellViewModel>(); var dest = new DeployDestinationViewModel(mainViewModel, CustomContainer.Get <Microsoft.Practices.Prism.PubSubEvents.IEventAggregator>()); var stats = new DeployStatsViewerViewModel(dest); var source = new DeploySourceExplorerViewModel(mainViewModel, CustomContainer.Get <Microsoft.Practices.Prism.PubSubEvents.IEventAggregator>(), stats); dest.StatsArea = stats; var vm = new SingleExplorerDeployViewModel(dest, source, new List <IExplorerTreeItem>(), stats, mainViewModel, CustomContainer.Get <IPopupController>()); ViewModel = vm; View = new DeployView(); ViewModel.PropertyChanged += (sender, args) => { if (args.PropertyName == "Header") { OnPropertyChanged("DisplayName"); } ViewModelUtils.RaiseCanExecuteChanged(mainViewModel?.SaveCommand); }; }