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()); }
public void GetAttachmentsTest() { Word2007OfficeDocument_Accessor target = new Word2007OfficeDocument_Accessor(Open(this.demoDoc)); ICollection <FileInfo> actual; actual = target.Attachments; Assert.AreEqual(actual.Count, 1); }
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); }
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); }
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); }
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); }
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); }
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); }
public void DefaultExtensionTest() { Word2007OfficeDocument_Accessor target = new Word2007OfficeDocument_Accessor(Open(this.demoDoc)); string actual; actual = target.DefaultExtension; string expected = ".docx"; Assert.AreEqual(actual, expected); }
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); }
public void IsNotNewTest() { Word2007OfficeDocument_Accessor target = new Word2007OfficeDocument_Accessor(Open(this.demoDoc)); bool actual; actual = target.IsNew; bool expected = false; Assert.AreEqual(actual, expected); }
public void isReadOnlyTest() { Word2007OfficeDocument_Accessor target = new Word2007OfficeDocument_Accessor(Open(this.demoDoc)); bool actual; actual = target.IsReadOnly; bool expected = true; Assert.AreEqual(actual, expected); }
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); }
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); }
public void SaveTestWithoutFile() { Word2007OfficeDocument_Accessor target = new Word2007OfficeDocument_Accessor(Open(this.demoDoc)); target.Save(); }