private void DoCreateProjectAndExperimentWork(object sender, DoWorkEventArgs e) { // the sender property is a reference to the dialog's BackgroundWorker // component BackgroundWorker worker = (BackgroundWorker)sender; ProjectBase project = e.Argument as ProjectBase; CreateProjectHelper helper = new CreateProjectHelper(worker, project); worker.ReportProgress(50, "Creating project and experiment"); helper.CreateProjectDirectoryStructure(); helper.CopyDataFiles(); helper.ReadPeptides(); worker.ReportProgress(50, "Saving"); project.Save(); }
public void TestInitialize() { eventAggregator = new EventAggregator(); mockServiceLocator = new Mock<IServiceLocator>(); mockServiceLocator.Setup(mock => mock.GetAllInstances<IExperimentType>()).Returns(new List<IExperimentType>() { new HydraExperimentType(mockServiceLocator.Object) }); worker = new BackgroundWorker(); worker.WorkerReportsProgress = true; project = new ProjectBase("temp", @"c:\"); project.ExperimentReferences.Add(new MassSpecStudio.Core.Domain.ProjectBase.ExperimentReference(TestExperimentName, @"c:\temp\" + TestExperimentName + @"\" + TestExperimentName + ".mssexp", new HydraExperimentType(mockServiceLocator.Object).ExperimentType)); helper = new CreateProjectHelper(worker, project); if (Directory.Exists(TestExperimentDirectory)) { Directory.Delete(TestExperimentDirectory, true); } }