Ejemplo n.º 1
0
        public static ProjectBase CreateTestProject()
        {
            DeleteProjectDirectory();

            Mock<IEventAggregator> mockEventAggregator = new Mock<IEventAggregator>();
            Mock<IServiceLocator> mockServiceLocator = new Mock<IServiceLocator>();
            mockServiceLocator.Setup(mock => mock.GetAllInstances<IDataProvider>()).Returns(new List<IDataProvider>() { new ProteoWizardDataProvider(mockEventAggregator.Object) });
            ProjectBase project = new ProjectBase("temp", @"c:\");
            HydraExperimentType hydraExperimentType = new HydraExperimentType(mockServiceLocator.Object);
            Experiment experiment = hydraExperimentType.CreateExperiment(project, "testExperiment") as Experiment;
            ProteinState proteinState1 = new ProteinState(experiment);
            ProteinState proteinState2 = new ProteinState(experiment);
            Labeling labeling1 = new Labeling(experiment);
            Labeling labeling2 = new Labeling(experiment);

            CreateRun(Properties.Settings.Default.mzXMLTestFile1, proteinState1, labeling1, experiment, mockEventAggregator);
            CreateRun(Properties.Settings.Default.mzXMLTestFile2, proteinState1, labeling1, experiment, mockEventAggregator);
            CreateRun(Properties.Settings.Default.mzXMLTestFile2, proteinState1, labeling2, experiment, mockEventAggregator);
            CreateRun(Properties.Settings.Default.mzXMLTestFile2, proteinState2, labeling1, experiment, mockEventAggregator);

            experiment.Peptides.PeptideCollection.Add(CreatePeptide("SAMPLE", 1));
            experiment.Peptides.PeptideCollection.Add(CreatePeptide("SAMPLES", 20));

            experiment.Save();
            project.Experiments.Add(experiment);
            return project;
        }
Ejemplo n.º 2
0
        public void ClassInitialize()
        {
            mockServiceLocator = new Mock<IServiceLocator>();
            mockEventAggregator = new Mock<IEventAggregator>();
            hydraExperimentType = new HydraExperimentType(mockServiceLocator.Object);
            project = new ProjectBase("temp", @"C:\");

            try
            {
                if (Directory.Exists(TestExperimentDirectory))
                {
                    Directory.Delete(TestExperimentDirectory, true);
                }
            }
            catch
            {
                // Do Nothing
            }
        }