Beispiel #1
0
        public void BuildListTest()
        {
            int scanNumber = 0;                                                                       // TODO: Initialize to an appropriate value
            IExperimentParser experimentParser = null;                                                // TODO: Initialize to an appropriate value
            ActualListBuilder target           = new ActualListBuilder(scanNumber, experimentParser); // TODO: Initialize to an appropriate value

            target.BuildList();
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
Beispiel #2
0
 /// <summary>
 /// This constructor takes in a scan number of the desired experiment data with a provided parser that is not null.
 /// </summary>
 /// <param name="scanNumber">A scan number referenecing data in an experiment file.</param>
 /// <param name="experimentParser">An interface for reading experiment files (i.e. ".mzXML"...).</param>
 public ActualListBuilder(int scanNumber, IExperimentParser experimentParser)
 {
     if (experimentParser != null)
     {
         m_scanNumber = scanNumber;
         m_fileParser = experimentParser;
         ElementList  = new List <Element>();
     }
     else
     {
         //Throw Exception?
     }
 }
Beispiel #3
0
        public List <Element> BuildActualList(int scanNumber, string fileLocation)       //Idea is to check the extension, call the right parser based on extension of file name.
        {
            string mzXML     = ".mzxml";
            string raw       = ".raw";
            string extension = Path.GetExtension(fileLocation);

            extension = extension.ToLower();
            if (m_parser == null)
            {
                if (extension.Equals(mzXML))
                {
                    m_parser        = new MzParser(fileLocation);
                    m_actualBuilder = new ActualListBuilder(scanNumber, m_parser);
                }

                if (extension.Equals(raw))
                {
                    m_parser        = new ThermoRawParser(fileLocation);
                    m_actualBuilder = new ActualListBuilder(scanNumber, m_parser);
                }
            }
            else
            {
                if (m_parser.Filename != fileLocation)
                {
                    if (extension.Equals(mzXML))
                    {
                        m_parser        = new MzParser(fileLocation);
                        m_actualBuilder = new ActualListBuilder(scanNumber, m_parser);
                    }

                    if (extension.Equals(raw))
                    {
                        m_parser        = new ThermoRawParser(fileLocation);
                        m_actualBuilder = new ActualListBuilder(scanNumber, m_parser);
                    }
                }

                m_actualBuilder.SetScanNumber(scanNumber);
            }


            m_actualBuilder.BuildList();

            return(m_actualBuilder.ElementList);
        }