public void Theme01EditAttribute() { this.MyTestInitialize(TestContext.GetCurrentMethod()); try { string originalFilepath = this.GetTestFilePath(this.generateDocumentFilePath); string editFilePath = this.GetTestFilePath(this.editDocumentFilePath); System.IO.File.Copy(originalFilepath, editFilePath, true); // Adding ThemeId using (PresentationDocument doc = PresentationDocument.Open(editFilePath, true)) { try { doc.PresentationPart.SlideMasterParts.First().ThemePart.Theme.ThemeId = new DocumentFormat.OpenXml.StringValue("TEST"); } catch (Exception e) { this.Log.Fail(e.Message); } } TestEntities testEntities = new TestEntities(); testEntities.EditAttribute(editFilePath, this.Log); testEntities.VerifyAttribute(editFilePath, this.Log); } catch (Exception e) { this.Log.Fail(e.Message); } }
public void Theme01EditAttribute() { using (var stream = new MemoryStream()) { GeneratedDocument.CreatePackage(stream); // Adding ThemeId using (PresentationDocument doc = PresentationDocument.Open(stream, true)) { doc.PresentationPart.SlideMasterParts.First().ThemePart.Theme.ThemeId = new StringValue("TEST"); } TestEntities testEntities = new TestEntities(); testEntities.EditAttribute(stream, Log); testEntities.VerifyAttribute(stream, Log); } }
public void Theme01EditAttribute() { string originalFilepath = GetTestFilePath(generateDocumentFilePath); string editFilePath = GetTestFilePath(editDocumentFilePath); System.IO.File.Copy(originalFilepath, editFilePath, true); // Adding ThemeId using (PresentationDocument doc = PresentationDocument.Open(editFilePath, true)) { doc.PresentationPart.SlideMasterParts.First().ThemePart.Theme.ThemeId = new DocumentFormat.OpenXml.StringValue("TEST"); } TestEntities testEntities = new TestEntities(); testEntities.EditAttribute(editFilePath, Log); testEntities.VerifyAttribute(editFilePath, Log); }