Ejemplo n.º 1
0
        public void TestAddTracking()
        {
            var filenames = new List<string>()
                {
                    "ReadyRedlineDocumentTrackingTest.doc",
                    "NoPassword.docx",
                    "RemovePassword.docx",
                    "password_removed.docx",
                    "Sample Original Document _ Office 2010 SP2.docx",
                    "Sample Original Document _ Office 2013 Format.docx",
                    "Sample Original Document _ Strict Open XML.docx"
                };

            filenames.ForEach(delegate(string x)
                {
                    string testfile = Workshare.TestUtils.TestFileUtils.MakeRootPathAbsolute(Path.Combine(_path, x));
                    string tempfile = System.IO.Path.Combine(System.IO.Path.GetTempPath(), System.IO.Path.GetFileName(testfile));
                    System.IO.File.Copy(testfile, tempfile, true);

                    var intelligentDocument = new IntelligentDocument();
                    intelligentDocument.SetFileName(tempfile);
                    Assert.False(intelligentDocument.IsDocumentBeingTracked());
                    intelligentDocument.AddDocumentTrackingId();
                    Assert.True(intelligentDocument.IsDocumentBeingTracked());                
                });
        }