protected void Initialize() { MockEventAggregator = new Mock<IEventAggregator>(); MockRegionManager = new Mock<IRegionManager>(); MockServiceLocator = new Mock<IServiceLocator>(); MockBackgroundWorker = new Mock<BackgroundWorker>(); OutputEvent = new OutputEvent(); ClickableOutputEvent = new ClickableOutputEvent(); ProjectOpeningEvent projectOpeningEvent = new ProjectOpeningEvent(); LoadProjectEvent loadProjectEvent = new LoadProjectEvent(); ClearOutputEvent clearOutputEvent = new ClearOutputEvent(); ResultAddedEvent resultAddedEvent = new ResultAddedEvent(); ViewResultsEvent viewResultsEvent = new ViewResultsEvent(); StatusUpdateEvent statusUpdateEvent = new StatusUpdateEvent(); MockEventAggregator.Setup(mock => mock.GetEvent<ClearOutputEvent>()).Returns(clearOutputEvent); MockEventAggregator.Setup(mock => mock.GetEvent<OutputEvent>()).Returns(OutputEvent); MockEventAggregator.Setup(mock => mock.GetEvent<ClickableOutputEvent>()).Returns(ClickableOutputEvent); MockEventAggregator.Setup(mock => mock.GetEvent<ProjectOpeningEvent>()).Returns(projectOpeningEvent); MockEventAggregator.Setup(mock => mock.GetEvent<LoadProjectEvent>()).Returns(loadProjectEvent); MockEventAggregator.Setup(mock => mock.GetEvent<ResultAddedEvent>()).Returns(resultAddedEvent); MockEventAggregator.Setup(mock => mock.GetEvent<ViewResultsEvent>()).Returns(viewResultsEvent); MockEventAggregator.Setup(mock => mock.GetEvent<StatusUpdateEvent>()).Returns(statusUpdateEvent); List<IExperimentType> experimentTypes = new List<IExperimentType>(); experimentTypes.Add(new HydraExperimentType(MockServiceLocator.Object)); List<IDataProvider> dataProviders = new List<IDataProvider>(); dataProviders.Add(new ProteoWizardDataProvider(MockEventAggregator.Object)); MockServiceLocator.Setup(mock => mock.GetAllInstances<IExperimentType>()).Returns(experimentTypes); MockServiceLocator.Setup(mock => mock.GetAllInstances<IDataProvider>()).Returns(dataProviders); }
public MsMsSpectrumSelection(IEventAggregator eventAggregator, IRegionManager regionManager) { this.eventAggregator = eventAggregator; this.regionManager = regionManager; clickableOutput = eventAggregator.GetEvent<ClickableOutputEvent>(); LCPeakElutionWidth = 1; MZVariablility = 0.2; }
public void MyTestInitialize() { mockDataProvider = new Mock<IDataProvider>(); Mock<IEventAggregator> mockEventAggregator = new Mock<IEventAggregator>(); Mock<IRegionManager> mockRegionManager = new Mock<IRegionManager>(); clickableOutputEvent = new ClickableOutputEvent(); mockEventAggregator.Setup(mock => mock.GetEvent<ClickableOutputEvent>()).Returns(clickableOutputEvent); xicSelection = new XicSelection(mockEventAggregator.Object, mockRegionManager.Object); }
public SavitzkyGolaySmoothing(IEventAggregator eventAggregator, IRegionManager regionManager) { _eventAggregator = eventAggregator; _output = eventAggregator.GetEvent<OutputEvent>(); _clickableOutput = eventAggregator.GetEvent<ClickableOutputEvent>(); _regionManager = regionManager; Enabled = true; LeftParam = 3; RightParam = 3; Order = 2; }
private void OnPublish(ClickableOutputEvent outputEvent) { publishCalled = true; Assert.AreEqual(" XIC found (sample=test.mzxml, x values=2, y values=2, time unit=Seconds)", outputEvent.Text); Assert.AreEqual(2, ((IXYData)outputEvent.Parameter).XValues.Count); Assert.AreEqual(1, ((IXYData)outputEvent.Parameter).XValues[0]); Assert.AreEqual(2, ((IXYData)outputEvent.Parameter).XValues[1]); Assert.AreEqual(3, ((IXYData)outputEvent.Parameter).YValues[0]); Assert.AreEqual(4, ((IXYData)outputEvent.Parameter).YValues[1]); Assert.IsNotNull(outputEvent.Click); }
public IXYData Execute(Sample sample, double rt, double mz) { IXYData spectrum = sample.GetMsMsSpectrum(rt, LCPeakElutionWidth, mz, mzVariability); spectrum.Title = "MSMS (RT=" + rt.ToString("N2") + " LCPeakElutionWidth=" + LCPeakElutionWidth.ToString("N2") + " mz=" + mz.ToString("N2") + " MZ Range=" + mzVariability.ToString("N2") + ") - " + Path.GetFileName(sample.FileName); ClickableOutputEvent clickableOutput = new ClickableOutputEvent(); clickableOutput.Click = new DelegateCommand<IXYData>(OnViewXIC); clickableOutput.Text = " MSMS Spectrum found (sample=" + sample.FileName + ", x values=" + spectrum.XValues.Count + ", y values=" + spectrum.YValues.Count + ")"; clickableOutput.Parameter = spectrum; this.clickableOutput.Publish(clickableOutput); return spectrum; }
public IXYData Execute(Sample sample, double mass1) { IXYData xicData = sample.GetExtractedIonChromatogram(mass1, mass1, _mzVar, Core.TimeUnit.Seconds); xicData.Title = "XIC (" + mass1.ToString("N4") + " mzTol=" + _mzVar + ") - " + Path.GetFileName(sample.FileName); ClickableOutputEvent clickableOutput = new ClickableOutputEvent(); clickableOutput.Click = new DelegateCommand<IXYData>(OnViewXIC); clickableOutput.Text = " XIC found (sample=" + sample.FileName + ", x values=" + xicData.XValues.Count + ", y values=" + xicData.YValues.Count + ", time unit=" + xicData.TimeUnit + ")"; clickableOutput.Parameter = xicData; _clickableOutput.Publish(clickableOutput); return xicData; }
private void AddClickableOutput(ClickableOutputEvent value) { OutputText.Add(new ClickableText(value.Text, value.Click, value.Parameter)); }
public XicSelection(IEventAggregator eventAggregator, IRegionManager regionManager) { _eventAggregator = eventAggregator; _regionManager = regionManager; _clickableOutput = _eventAggregator.GetEvent<ClickableOutputEvent>(); }
public void MyTestInitialize() { Mock<IRegionManager> mockRegionManager = new Mock<IRegionManager>(); mockDataProvider = new Mock<IDataProvider>(); mockEventAggregator = new Mock<IEventAggregator>(); outputEvent = new OutputEvent(); clickableOutputEvent = new ClickableOutputEvent(); mockEventAggregator.Setup(mock => mock.GetEvent<ClickableOutputEvent>()).Returns(clickableOutputEvent); mockEventAggregator.Setup(mock => mock.GetEvent<OutputEvent>()).Returns(outputEvent); smoothing = new SavitzkyGolaySmoothing(mockEventAggregator.Object, mockRegionManager.Object); }
private void OnClickablePublish(ClickableOutputEvent actualValue) { clickablePublishCalled = true; Assert.AreEqual(" Smoothing completed", actualValue.Text); }
public IXYData Execute(Sample sample, double startTime, double stopTime, double monoIsotopicMass) { IXYData spectrum = sample.GetSpectrum(startTime, stopTime, monoIsotopicMass + MZLowerOffset, monoIsotopicMass + MZUpperOffset, 0); spectrum.Title = "MS (RT=" + startTime.ToString("N2") + "-" + stopTime.ToString("N2") + " Mass=" + monoIsotopicMass.ToString("N4") + ") - " + Path.GetFileName(sample.FileName); ClickableOutputEvent clickableOutput = new ClickableOutputEvent(); clickableOutput.Click = new DelegateCommand<IXYData>(OnViewXIC); clickableOutput.Text = " Spectrum found (sample=" + sample.FileName + ", x values=" + spectrum.XValues.Count + ", y values=" + spectrum.YValues.Count + ")"; clickableOutput.Parameter = spectrum; _clickableOutput.Publish(clickableOutput); return spectrum; }