public static ExporterBase <ScanResult> CreateMSScanInfoExporterFactory(Globals.ExporterType exporterType, Globals.MSFileType msFileType, string outputFileName) { Check.Assert(!string.IsNullOrEmpty(outputFileName), "MSScanInfoExporterFactory cannot work. OutputFileName is empty - which is bad."); ExporterBase <ScanResult> msFeatureExporter; switch (exporterType) { case Globals.ExporterType.Text: switch (msFileType) { case Globals.MSFileType.PNNL_UIMF: msFeatureExporter = new MSScanInfoToTextFileExporterUIMF(outputFileName); break; default: msFeatureExporter = new MSScanInfoToTextFileExporterBasic(outputFileName); break; } break; case Globals.ExporterType.Sqlite: switch (msFileType) { case Globals.MSFileType.PNNL_UIMF: msFeatureExporter = new MSScanInfoToSQLiteExporterUIMF(outputFileName); break; default: msFeatureExporter = new MSScanInfoToSQLiteExporterBasic(outputFileName); break; } break; default: throw new NotImplementedException(); } return(msFeatureExporter); }
public void outputToText_UIMFData_Test1() { var exportedFile = exportedMSScanInfoToTextFileFromUIMFFile1; if (File.Exists(exportedFile)) { File.Delete(exportedFile); } //create run and get some results var run = TestDataCreationUtilities.CreateResultsFromTwoFramesOfStandardUIMFData(); ExporterBase <ScanResult> exporter = new DeconTools.Backend.FileIO.MSScanInfoToTextFileExporterUIMF(exportedFile); exporter.ExportResults(run.ResultCollection.ScanResultList); Assert.AreEqual(true, File.Exists(exportedFile)); var fi = new FileInfo(exportedFile); Assert.AreEqual(220, fi.Length); Console.Write(fi.Length); }