public CustomizationManagerControl() { InitializeComponent(); solutionComponentsContainer = new SolutionComponentsContainer(); solutionComponentsContainer.Show(dockPanel, DockState.DockLeft); prototypesContainer = new PrototypesContainer(); prototypesContainer.Show(dockPanel, DockState.DockRight); }
public void ControlNeedsViewModel() { var solutionComponentsContainer = new SolutionComponentsContainer(); var ex = Record.Exception(() => solutionComponentsContainer.InitializeBindings(null)); Assert.NotNull(ex); Assert.IsType <ArgumentNullException>(ex); Assert.Equal("Value cannot be null.\r\nParameter name: toolViewModel", ex.Message); }
public void RefreshSolutionListUsesService() { var iWorkerHostWrapper = A.Fake <IWorkerHostWrapper>(); var solutionComponentsContainer = new SolutionComponentsContainer(); var toolViewModel = new ToolViewModel { OrganizationService = _service }; toolViewModel.AsyncWorkQueue = new AsyncWorkQueue(iWorkerHostWrapper, toolViewModel); solutionComponentsContainer.InitializeBindings(toolViewModel); var doWorkEventArgs = new DoWorkEventArgs(null); solutionComponentsContainer.RefreshSolutionList(A.Fake <BackgroundWorker>(), doWorkEventArgs); A.CallTo(() => _service.RetrieveMultiple(A <QueryExpression> .Ignored)).MustHaveHappened(1, Times.Exactly); }
public void MnuRefreshSolutionsUsesService() { _context.Initialize(new Solution[] { new Solution() { SolutionId = Guid.NewGuid(), FriendlyName = "Active Solution", UniqueName = "Active" }, new Solution() { SolutionId = Guid.NewGuid(), FriendlyName = "Default Solution", UniqueName = "Default" } }); var iWorkerHostWrapper = new DummyBackgroundWorkerHostWrapper(); var solutionComponentsContainer = new SolutionComponentsContainer(); var toolViewModel = new ToolViewModel { OrganizationService = _service }; toolViewModel.AsyncWorkQueue = new AsyncWorkQueue(iWorkerHostWrapper, toolViewModel); solutionComponentsContainer.InitializeBindings(toolViewModel); var stopwatch = new Stopwatch(); stopwatch.Start(); solutionComponentsContainer.MnuRefreshSolutions_Click(null, new EventArgs()); while (iWorkerHostWrapper.Working > 0 && stopwatch.ElapsedMilliseconds < 10000) //10 seconds threshold for the asynchronous operation { Thread.Sleep(15); } Assert.Equal("Default", (solutionComponentsContainer.cmbFilteringSolution.SelectedItem as Solution)?.UniqueName); }