public async Task GetWordCountTest_Basic2()
        {
            string inputFile = @".\LockeFiles.zip";

            ArchiveFileHandler        afh    = new ArchiveFileHandler();
            FileInfo                  fi     = new FileInfo(inputFile);
            Dictionary <string, long> counts = await afh.GetWordCount(fi);

            Assert.AreEqual(
                FileWordCounts.EssayConcerningHumaneUnderstandingVol1 + FileWordCounts.EssayConcerningHumaneUnderstandingVol2,
                counts.Values.Sum());
        }
        public async Task GetWordCountTest_Basic1()
        {
            string inputFile = @".\BerkeleyFiles.zip";

            ArchiveFileHandler        afh    = new ArchiveFileHandler();
            FileInfo                  fi     = new FileInfo(inputFile);
            Dictionary <string, long> counts = await afh.GetWordCount(fi);

            Assert.AreEqual(
                FileWordCounts.PrinciplesofHumanKnowledge + FileWordCounts.ThreeDialogues,
                counts.Values.Sum());
        }
        public async Task GetWordCountTest_ArchiveWithSubdirs()
        {
            string inputFile = @".\NestedFiles.zip";

            ArchiveFileHandler        afh    = new ArchiveFileHandler();
            FileInfo                  fi     = new FileInfo(inputFile);
            Dictionary <string, long> counts = await afh.GetWordCount(fi);

            long allFilesWordCount =
                FileWordCounts.PrinciplesofHumanKnowledge +
                FileWordCounts.ThreeDialogues +
                FileWordCounts.CritiqueofPureReason +
                FileWordCounts.Theodicy +
                FileWordCounts.EssayConcerningHumaneUnderstandingVol1 +
                FileWordCounts.EssayConcerningHumaneUnderstandingVol2;

            Assert.AreEqual(allFilesWordCount, counts.Values.Sum());
        }
Ejemplo n.º 4
0
 public FileHandlerController()
 {
     this.textHandler    = new TextFileHandler();
     this.archiveHandler = new ArchiveFileHandler(this.textHandler);
 }
Ejemplo n.º 5
0
 static LibraryManager()
 {
     FileSystemHandler.Register();
     ArchiveFileHandler.Register();
 }