コード例 #1
0
ファイル: ThemeTest.cs プロジェクト: yuekunge/Open-XML-SDK
        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);
            }
        }
コード例 #2
0
ファイル: ThemeTest.cs プロジェクト: thundertd/Open-XML-SDK
        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);
            }
        }
コード例 #3
0
ファイル: ThemeTest.cs プロジェクト: stengfei/Open-XML-SDK
        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.");
        }
コード例 #4
0
ファイル: ThemeTest.cs プロジェクト: eriawan/Open-XML-SDK
        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);
            }
        }