public static void Main(string[] args)
        {
            // ensure path to file is absolute, not relative
            string filename = args[0];
            if (!Path.IsPathRooted(filename))
                filename = Path.Combine(Environment.CurrentDirectory, filename);

            Discoverer d = new Discoverer();

            string xmlReport = d.DiscoverDocumentToXml(filename);
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(xmlReport);
            // process XML report
            
            string htmlReport = d.DiscoverDocumentToHtmlReport(filename);
            // display HTML report
        }
Exemple #2
0
 public void TestRelativePath2()
 {
     IDiscoverer c = new Discoverer();
     c.DiscoverDocumentToHtmlReport("test.doc");
 }
Exemple #3
0
        public void TestDiscoverToHtmlTwice()
        {
            Discoverer d = new Discoverer();
            string testDoc = TestUtils.TestFileUtils.MakeRootPathAbsolute(@"Projects\Workshare.API\Workshare.API.Tests\TestDocs\test.xls");

            string report = d.DiscoverDocumentToHtmlReport(testDoc);
            Assert.IsFalse(string.IsNullOrEmpty(report));
            Assert.IsTrue(File.Exists(report));

            string report2 = d.DiscoverDocumentToHtmlReport(testDoc);
            Assert.IsFalse(string.IsNullOrEmpty(report2));
            Assert.IsTrue(File.Exists(report2));
            Assert.IsTrue(File.Exists(report));

            Assert.AreNotEqual(report, report2);
            Assert.IsFalse(string.Compare(report, report2, true) == 0);

            File.Delete(report);
            File.Delete(report2);

        }
Exemple #4
0
		public void TestDiscoverPDFToHtml()
		{
			Discoverer d = new Discoverer();
			string testDoc = TestUtils.TestFileUtils.MakeRootPathAbsolute(@"Projects\Workshare.API\Workshare.API.Tests\TestDocs\Comments_Bookmarks_Attachments_Markups.pdf");

			string report = d.DiscoverDocumentToHtmlReport(testDoc);
			Assert.IsFalse(string.IsNullOrEmpty(report));
			Assert.IsTrue(File.Exists(report));
			string contents = File.ReadAllText(report);
			File.Delete(report);

			Assert.IsTrue(contents.StartsWith("<html "));
			Assert.IsTrue(contents.Length > 7000);
			// and can test for extant phrases of each type:
			Assert.IsTrue(contents.IndexOf("TextAnnotation on page") > 0);
			Assert.IsTrue(contents.IndexOf("Keywords: AcroTeX, AeB Pro, Acrobat annotations") > 0);
			Assert.IsTrue(contents.IndexOf("AAA.docx") > 0);
			Assert.IsTrue(contents.IndexOf("1 Introduction , links to page # 2") > 0);
		}
Exemple #5
0
        public void TestDiscoverToHtml()
        {
            Discoverer d = new Discoverer();
            string testDoc = TestUtils.TestFileUtils.MakeRootPathAbsolute(@"Projects\Workshare.API\Workshare.API.Tests\TestDocs\test.xls");

            string report = d.DiscoverDocumentToHtmlReport(testDoc);
            Assert.IsFalse(string.IsNullOrEmpty(report));
            Assert.IsTrue(File.Exists(report));
            string contents = File.ReadAllText(report);
            File.Delete(report);

            Assert.IsTrue(contents.StartsWith("<html "));
        }