Exemplo n.º 1
0
        public void ValidateNonExistFileConversion()
        {
            var inputFile = Utility.NonExistentInputFile;
            var converter = new GenericFormatConverter();

            converter.ConvertWordToOneNote(inputFile, Utility.RootFolder);
        }
Exemplo n.º 2
0
        public void ValidateNonExistOutputFolder()
        {
            var outputDir = Utility.NonExistentOutputPath;
            var converter = new GenericFormatConverter();

            converter.ConvertWordToOneNote(TestDocPath, outputDir);
        }
Exemplo n.º 3
0
        public void ValidateEpubConversion()
        {
            var converter = new GenericFormatConverter();

            converter.ConvertEpubToOneNote(TestEpubPath, Utility.RootFolder);

            // retrieve xml from generated notebook
            var xmlDoc = _mOnGenerator.GetPageScopeHierarchy(_mNotebookId);

            Assert.IsNotNull(xmlDoc);

            // retrieve the section for the ppt conversion
            string    sectionName = Path.GetFileNameWithoutExtension(TestEpubPath);
            XDocument xDoc        = XDocument.Parse(xmlDoc);
            XElement  xSection    = xDoc.Descendants(_mXmlNs + "Section").FirstOrDefault(x => x.Attribute("name").Value.Equals(sectionName));

            Assert.IsNotNull(xSection);

            //get the xml of each pages
            var extractedPageTitles = xSection.Descendants(_mXmlNs + "Page").Select(x => x.Attribute("name").Value).ToList();

            CollectionAssert.AreEqual(EpubPageTitles, extractedPageTitles);
        }