コード例 #1
0
        public void Word2007OfficeDocumentConstructorTest()
        {
            Word2007OfficeDocument_Accessor target = new Word2007OfficeDocument_Accessor(Open(this.demoDoc));
            Word2007OfficeDocument_Accessor actual = new Word2007OfficeDocument_Accessor(this.application.ActiveDocument);

            Assert.AreEqual(actual.FilePath.FullName.ToUpperInvariant(), target.FilePath.FullName.ToUpperInvariant());
        }
コード例 #2
0
        public void GetAttachmentsTest()
        {
            Word2007OfficeDocument_Accessor target = new Word2007OfficeDocument_Accessor(Open(this.demoDoc));
            ICollection <FileInfo>          actual;

            actual = target.Attachments;
            Assert.AreEqual(actual.Count, 1);
        }
コード例 #3
0
        public void GetApplicationVersionTest()
        {
            Word2007OfficeDocument_Accessor target = new Word2007OfficeDocument_Accessor(Open(this.demoDoc));
            string expected = "12.0";
            string actual;

            actual = target.ApplicationVersion;
            Assert.AreEqual(expected, actual);
        }
コード例 #4
0
        public void GetCustomPropertiesTest()
        {
            Word2007OfficeDocument_Accessor target   = new Word2007OfficeDocument_Accessor(Open(this.demoDoc));
            Dictionary <string, string>     expected = new Dictionary <string, string>(); // TODO: Initialize to an appropriate value
            Dictionary <string, string>     actual;

            actual = target.CustomProperties;
            Assert.AreEqual(expected.Count, actual.Count);
        }
コード例 #5
0
        public void GetLocalPathTest()
        {
            Word2007OfficeDocument_Accessor target = new Word2007OfficeDocument_Accessor(Open(this.demoDoc));
            FileInfo actual;

            actual = target.FilePath;
            Assert.AreEqual(this.demoDoc.FullName.ToUpperInvariant(), actual.FullName.ToUpperInvariant());
            Assert.IsTrue(actual.Exists);
        }
コード例 #6
0
        public void DocumentTypeTest()
        {
            Word2007OfficeDocument_Accessor target = new Word2007OfficeDocument_Accessor(Open(this.demoDoc));
            DocumentType expected = DocumentType.Word;
            DocumentType actual;

            actual = target.DocumentType;
            Assert.AreEqual(expected, actual);
        }
コード例 #7
0
        public void SaveCustomPropertiesTest()
        {
            Word2007OfficeDocument_Accessor target     = new Word2007OfficeDocument_Accessor(Open(this.demoDoc));
            Dictionary <string, string>     properties = new Dictionary <string, string>();

            properties.Add("id", "1");
            properties.Add("tp", "2");
            target.SaveCustomProperties(properties);
        }
コード例 #8
0
        public void SaveTestWithFile()
        {
            Word2007OfficeDocument_Accessor target = new Word2007OfficeDocument_Accessor(Open(this.demoDoc));
            FileInfo file = new FileInfo("c:\\temp\\demodemodemo\\demo" + target.DefaultExtension);

            target.Save(file);
            Assert.AreEqual(file.FullName.ToUpperInvariant(), target.FilePath.FullName.ToUpperInvariant());
            Assert.IsTrue(file.Exists);
        }
コード例 #9
0
        public void DefaultExtensionTest()
        {
            Word2007OfficeDocument_Accessor target = new Word2007OfficeDocument_Accessor(Open(this.demoDoc));
            string actual;

            actual = target.DefaultExtension;
            string expected = ".docx";

            Assert.AreEqual(actual, expected);
        }
コード例 #10
0
        public void DocumentFilterTest()
        {
            Word2007OfficeDocument_Accessor target = new Word2007OfficeDocument_Accessor(Open(this.demoDoc));
            string actual;

            actual = target.DocumentFilter;
            string expected = "Documento de Word(*.docx)|*.docx";

            Assert.AreEqual(actual, expected);
        }
コード例 #11
0
        public void IsNotNewTest()
        {
            Word2007OfficeDocument_Accessor target = new Word2007OfficeDocument_Accessor(Open(this.demoDoc));
            bool actual;

            actual = target.IsNew;
            bool expected = false;

            Assert.AreEqual(actual, expected);
        }
コード例 #12
0
        public void isReadOnlyTest()
        {
            Word2007OfficeDocument_Accessor target = new Word2007OfficeDocument_Accessor(Open(this.demoDoc));
            bool actual;

            actual = target.IsReadOnly;
            bool expected = true;

            Assert.AreEqual(actual, expected);
        }
コード例 #13
0
        public void SaveAsHtmlTest()
        {
            Word2007OfficeDocument_Accessor target = new Word2007OfficeDocument_Accessor(Open(this.demoDoc));
            DirectoryInfo dir      = new DirectoryInfo(@"c:\temp\tempdemo\");
            FileInfo      expected = new FileInfo(dir.FullName + "\\demo.html");
            FileInfo      actual;

            actual = target.SaveAsHtml(dir);
            Assert.AreEqual(expected.FullName.ToUpperInvariant(), actual.FullName.ToUpperInvariant());
            Assert.IsTrue(actual.Exists);
        }
コード例 #14
0
        public void isNotReadOnlyTest()
        {
            object missing = System.Type.Missing;

            this.application.Documents.Add(ref missing, ref missing, ref missing, ref missing);
            Word2007OfficeDocument_Accessor target = new Word2007OfficeDocument_Accessor(this.application.ActiveDocument);
            bool actual;

            actual = target.IsReadOnly;
            bool expected = false;

            Assert.AreEqual(actual, expected);
        }
コード例 #15
0
        public void SaveTestWithoutFile()
        {
            Word2007OfficeDocument_Accessor target = new Word2007OfficeDocument_Accessor(Open(this.demoDoc));

            target.Save();
        }