Ejemplo n.º 1
0
        public void LoadTest3()
        {
            string filename = Path.GetFullPath("MimeTypeDetection.cs");

            Assert.IsTrue(File.Exists(filename));

            CTokenizerParms args = new CTokenizerParms(filename, new CSourceFileID());
            CTokenSourceFileContentLoader target = new CTokenSourceFileContentLoader(args, CAvailableExtentions.GetExtention(LANGUAGES.LANGUAGE_C_SHARP));
            CCodeUnitsCollection          actual = target.Load();

            Assert.AreEqual(796, actual.Size());
        }
Ejemplo n.º 2
0
 private void IncreaseCountOfTokens(string filename)
 {
     try
     {
         CSourceFileID            FileID     = new CSourceFileID();
         CTokenizerParms          args       = new CTokenizerParms(filename, FileID);
         ISourceFileContentLoader loader     = new CTokenSourceFileContentLoader(args, m_Extension);
         CCodeUnitsCollection     collection = loader.Load();
         Interlocked.Add(ref m_CountOfTokens, collection.Size());
     }
     catch
     {
         // Если поддержка токенизации отсутствует, то ничего не делаем
     }
 }