예제 #1
0
        public void Dispose()
        {
            var keys = AllFileNames.ToArray();

            foreach (var key in keys)
            {
                data[key].Dispose();
                data.Remove(key);
            }
        }
예제 #2
0
        public UnitTestBase()
        {
            var rootSolution      = new DirectoryInfo(Environment.CurrentDirectory).Parent.Parent.Parent.Parent.FullName;
            var directoryWithPdfs = Path.Combine(rootSolution, "DimoPdfToExcelWeb", "wwwroot", "Files");

            string[] files = Directory.GetFiles(directoryWithPdfs);

            foreach (var fullFilePath in files)
            {
                string fileName = Path.GetFileName(fullFilePath);
                string ext      = Path.GetExtension(fullFilePath);
                if (ext.Equals(".pdf", StringComparison.InvariantCultureIgnoreCase))
                {
                    if (fileName.ToUpperInvariant().Contains("hungarian".ToUpperInvariant()))
                    {
                        HungarianFileNames.Add(fullFilePath);
                    }
                    if (fileName.ToUpperInvariant().Contains("serbian".ToUpperInvariant()))
                    {
                        SerbianFileNames.Add(fullFilePath);
                    }
                    if (fileName.ToUpperInvariant().Contains("croatian".ToUpperInvariant()))
                    {
                        CroatiaFileNames.Add(fullFilePath);
                    }
                    if (fileName.ToUpperInvariant().Contains("slovenian".ToUpperInvariant()))
                    {
                        SlovenianFileNames.Add(fullFilePath);
                    }
                }
            }

            AllFileNames.AddRange(HungarianFileNames);
            AllFileNames.AddRange(SerbianFileNames);

            WwwRootFolder = Path.Combine(rootSolution, "DimoPdfToExcelWeb", "wwwroot");
            Utils.PopulateHungarianMappingDictionaries(WwwRootFolder);
            Utils.PopulateSerbianMappingDictionaries(WwwRootFolder);
            Utils.PopulateCroatianMappingDictionaries(WwwRootFolder);
        }