public void TestUpdateSelectAnalysis() { var sidePanel = new AnalysesSidePanel(_dispatcher, _taskScheduler, _analysisStorage.Object, _pluginRegistry); sidePanel.SelectedAnalysis.Should().BeNull(); sidePanel.Update(); sidePanel.SelectedAnalysis.Should().BeNull(); AddAnalysis(); sidePanel.Update(); sidePanel.SelectedAnalysis.Should().NotBeNull("because now that an analysis has become available, it should be selected as well!"); }
public override void Update() { _selectedAnalysis?.Update(); _analysesSidePanel.Update(); //< TODO: Remove this hack! It ensures that we create a view model for the "current" analysis if (SelectedSidePanel != _analysesSidePanel) { SelectedSidePanel?.Update(); } }
public void TestRemoveAnalysis3() { AddAnalysis(); var sidePanel = new AnalysesSidePanel(_dispatcher, _taskScheduler, _analysisStorage.Object, _pluginRegistry); sidePanel.Update(); sidePanel.Active.Should().HaveCount(1); var viewModel = sidePanel.Active.First(); _analysisStorage.Verify(x => x.Remove(It.IsAny <AnalysisId>()), Times.Never); viewModel.RemoveCommand.Execute(null); _analysisStorage.Verify(x => x.Remove(It.Is <AnalysisId>(y => y == viewModel.Id)), Times.Once, "because the view model is responsible for removing the analysis (so it doesn't continue to run in the background)"); }