示例#1
0
 //分析文件夹内的eml文件,生成result列表
 public IList<ExtractorResultObject> GetListFromFolder(string folderPath)
 {
     DirectoryInfo di = new DirectoryInfo(folderPath);
     IList<ExtractorResultObject> resultList = new List<ExtractorResultObject>();
     string[] fileNames = Directory.GetFiles(folderPath, "*.eml", SearchOption.AllDirectories);
     foreach (string fileName in fileNames)
     {
         FileInfo fi = new FileInfo(fileName);
         ContentExtractor ce = new ContentExtractor(fi.FullName);
         ce.ExtractInfo();
         resultList.Add(ce.ResultObject);
     }
     return resultList;
 }
        private void validateOneResult(string emlFilePath,
            string clertname, string country, string email
            , string name, DateTime time, enumPlatFrom platform, string pname
           )
        {
            ContentExtractor ce = new ContentExtractor(emlFilePath);
            ce.ExtractInfo();
            ExtractorResultObject resultobject = ce.ResultObject;

            Assert.AreEqual(clertname, resultobject.ClerkName);
            Assert.AreEqual(country, resultobject.CustomCountry);
            Assert.AreEqual(email, resultobject.CustomEmail);
            Assert.AreEqual(name, resultobject.CustomName);
            Assert.AreEqual(time, resultobject.InquiryTime);
            Assert.AreEqual(platform, resultobject.PlatFrom);
            Assert.AreEqual(pname, resultobject.ProductName);
            resultList.Add(resultobject);
        }