Пример #1
0
        public void Theme03DeleteAttribute()
        {
            using (var stream = new MemoryStream())
            {
                GeneratedDocument.CreatePackage(stream);

                TestEntities testEntities = new TestEntities();
                testEntities.DeletAttribute(stream, Log);
                testEntities.VerifyDeletedAttribute(stream, Log);

                testEntities.AddAttribute(stream, Log);
                testEntities.VerifyAddedAttribute(stream, Log);
            }
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
        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);
        }
Пример #4
0
        public void Theme01EditAttribute()
        {
            this.MyTestInitialize(TestContext.GetCurrentMethod());

            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))
            {
                doc.PresentationPart.SlideMasterParts.First().ThemePart.Theme.ThemeId =
                    new DocumentFormat.OpenXml.StringValue("TEST");
            }

            TestEntities testEntities = new TestEntities();

            testEntities.EditAttribute(editFilePath, this.Log);
            testEntities.VerifyAttribute(editFilePath, this.Log);
        }
Пример #5
0
        public void Theme03DeleteAttribute()
        {
            string originalFilepath = GetTestFilePath(generateDocumentFilePath);
            string deleteFilePath   = GetTestFilePath(deleteDocumentFilePath);
            string addFilePath      = GetTestFilePath(addDocumentFilePath);

            System.IO.File.Copy(originalFilepath, deleteFilePath, true);
            Log.Comment("File copy [{0}] to [{1}]", originalFilepath, deleteFilePath);

            TestEntities testEntities = new TestEntities();

            testEntities.DeletAttribute(deleteFilePath, Log);
            testEntities.VerifyDeletedAttribute(deleteFilePath, Log);

            System.IO.File.Copy(deleteFilePath, addFilePath, true);
            Log.Comment("File copy [{0}] to [{1}]", deleteFilePath, addFilePath);

            testEntities.AddAttribute(addFilePath, Log);
            testEntities.VerifyAddedAttribute(addFilePath, Log);

            Log.Pass("Deleted the thm15:id attribute is complete.");
        }
Пример #6
0
        public void Theme03DeleteAttribute()
        {
            this.MyTestInitialize(TestContext.GetCurrentMethod());

            string originalFilepath = this.GetTestFilePath(this.generateDocumentFilePath);
            string deleteFilePath   = this.GetTestFilePath(this.deleteDocumentFilePath);
            string addFilePath      = this.GetTestFilePath(this.addDocumentFilePath);

            System.IO.File.Copy(originalFilepath, deleteFilePath, true);
            this.Log.Comment("File copy [{0}] to [{1}]", originalFilepath, deleteFilePath);

            TestEntities testEntities = new TestEntities();

            testEntities.DeletAttribute(deleteFilePath, this.Log);
            testEntities.VerifyDeletedAttribute(deleteFilePath, this.Log);

            System.IO.File.Copy(deleteFilePath, addFilePath, true);
            this.Log.Comment("File copy [{0}] to [{1}]", deleteFilePath, addFilePath);

            testEntities.AddAttribute(addFilePath, this.Log);
            testEntities.VerifyAddedAttribute(addFilePath, this.Log);

            this.Log.Pass("Deleted the thm15:id attribute is complete.");
        }
Пример #7
0
        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);
            }
        }
Пример #8
0
        public void Theme03DeleteAttribute()
        {
            this.MyTestInitialize(TestContext.GetCurrentMethod());
            try
            {
                string originalFilepath = this.GetTestFilePath(this.generateDocumentFilePath);
                string deleteFilePath = this.GetTestFilePath(this.deleteDocumentFilePath);
                string addFilePath = this.GetTestFilePath(this.addDocumentFilePath);

                System.IO.File.Copy(originalFilepath, deleteFilePath, true);
                this.Log.Comment("File copy [{0}] to [{1}]", originalFilepath, deleteFilePath);

                TestEntities testEntities = new TestEntities();
                testEntities.DeletAttribute(deleteFilePath, this.Log);
                testEntities.VerifyDeletedAttribute(deleteFilePath, this.Log);

                System.IO.File.Copy(deleteFilePath, addFilePath, true);
                this.Log.Comment("File copy [{0}] to [{1}]", deleteFilePath, addFilePath);

                testEntities.AddAttribute(addFilePath, this.Log);
                testEntities.VerifyAddedAttribute(addFilePath, this.Log);

                this.Log.Pass("Deleted the thm15:id attribute is complete.");
            }
            catch (Exception e)
            {
                this.Log.Fail(e.Message);
            }
        }