Ejemplo n.º 1
0
        /// <summary>
        /// Creates new record for generated document
        /// </summary>
        /// <param name="generatedDocument">Instance of <see cref="GeneratedDocumentDomain"/></param>
        /// <returns> Id of a newly generated document record. </returns>
        public int Add(GeneratedDocumentDomain generatedDocument)
        {
            var generatedDocumentDb = new GeneratedDocument().FromDomainModel(generatedDocument);

            _context.GeneratedDocument.Add(generatedDocumentDb);
            _context.SaveChanges();
            return(generatedDocumentDb.DocumentTypeId);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a base Word file for the tests
        /// </summary>
        /// <param name="createFilePath">Create Word file path</param>
        private void Initialize(string createFilePath)
        {
            GeneratedDocument generatedDocument = new GeneratedDocument();

            generatedDocument.CreatePackage(createFilePath);

            this.Log.Pass("Create Power Point file. File path=[{0}]", createFilePath);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates a base Power Point file for the tests
        /// </summary>
        /// <param name="createFilePath">Create Power Point file path</param>
        private void Initialize(string createFilePath)
        {
            GeneratedDocument generatedDocument = new GeneratedDocument();

            generatedDocument.CreatePackage(createFilePath);

            this.testEntities = new TestEntities(createFilePath);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Constructor
        /// </summary>
        public ChartTrackingRefBasedTest(ITestOutputHelper output)
            : base(output)
        {
            string            createFilePath    = GetTestFilePath(generateDocumentFile);
            GeneratedDocument generatedDocument = new GeneratedDocument();

            generatedDocument.CreatePackage(createFilePath);

            testEntities = new TestEntities(createFilePath);
        }
Ejemplo n.º 5
0
        public void ContentControl01EditElement()
        {
            using (var stream = new MemoryStream())
            {
                GeneratedDocument.CreatePackage(stream);

                EditElement.EditContentControlElements(stream, Log);
                VerifyElement.VerifyContentControlElement(stream, Log);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Constructor
        /// </summary>
        public ThemeTest(ITestOutputHelper output)
            : base(output)
        {
            string            createFilePath    = this.GetTestFilePath(this.generateDocumentFilePath);
            GeneratedDocument generatedDocument = new GeneratedDocument();

            generatedDocument.CreatePackage(createFilePath);

            this.Log.Pass("Create Power Point file. File path=[{0}]", createFilePath);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Constructor
        /// </summary>
        public SlicerTest(ITestOutputHelper output)
            : base(output)
        {
            string            createFilePath    = GetTestFilePath(generateDocumentFilePath);
            GeneratedDocument generatedDocument = new GeneratedDocument();

            generatedDocument.CreatePackage(createFilePath);

            Log.Pass("Create Word file. File path=[{0}]", createFilePath);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Constructor
        /// </summary>
        public ContentControlTest(ITestOutputHelper output)
            : base(output)
        {
            string            createFilePath    = this.GetTestFilePath(this.generatedDocumentFilePath);
            GeneratedDocument generatedDocument = new GeneratedDocument();

            generatedDocument.CreatePackage(createFilePath);

            this.Log.Pass("Create Word file. File path=[{0}]", createFilePath);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Creates a base Word file for the tests
        /// </summary>
        /// <param name="createFilePath">Create Word file path</param>
        private void Initialize(string createFilePath)
        {
            GeneratedDocument generatedDocument = new GeneratedDocument();

            generatedDocument.CreatePackage(createFilePath);

            this.Log.Pass("Create Word file. File path=[{0}]", createFilePath);

            this.testEntities = new TestEntities(createFilePath);
        }
Ejemplo n.º 10
0
        public void CommentEx04VerifyDelete()
        {
            using (var stream = new MemoryStream())
            {
                GeneratedDocument.Generate(stream);

                TestEntities.DeleteElements(stream);
                TestEntities.VerifyDeletedElements(stream);
            }
        }
Ejemplo n.º 11
0
        public void CommentEx02VerifyEdit()
        {
            using (var stream = new MemoryStream())
            {
                GeneratedDocument.Generate(stream);

                TestEntities.EditElements(stream);
                TestEntities.VerifyElements(stream);
            }
        }
Ejemplo n.º 12
0
        public void CommentExPeople01ReadElement()
        {
            using (var stream = new MemoryStream())
            {
                GeneratedDocument generatedDocument = new GeneratedDocument();
                generatedDocument.CreatePackage(stream);

                TestEntities testEntities = new TestEntities();
                testEntities.ReadElements(stream, Log);
            }
        }
Ejemplo n.º 13
0
        public void Slicer01EditElement()
        {
            using (var stream = new MemoryStream())
            {
                GeneratedDocument.CreatePackage(stream);

                TestEntities testEntities = new TestEntities();
                testEntities.EditElements(stream, Log);
                testEntities.VerifyElements(stream, Log);
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Constructor
        /// </summary>
        public WorkBookPrTest(ITestOutputHelper output)
            : base(output)
        {
            string            createFilePath    = this.GetTestFilePath(this.generatedDocumentFile);
            GeneratedDocument generatedDocument = new GeneratedDocument();

            generatedDocument.CreatePackage(createFilePath);

            this.Log.Pass("Create Word file. File path=[{0}]", createFilePath);

            this.testEntities = new TestEntities(createFilePath);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Constructor
        /// </summary>
        public ThreadingInfoTest(ITestOutputHelper output)
            : base(output)
        {
            string            createFilePath    = GetTestFilePath(generateDocumentFile);
            GeneratedDocument generatedDocument = new GeneratedDocument();

            generatedDocument.CreatePackage(createFilePath);

            Log.Pass("Create Power Point file. File path=[{0}]", createFilePath);

            testEntities = new TestEntities(createFilePath);
        }
        public void ChartTrackingRefBasedTest01()
        {
            using (var stream = new MemoryStream())
            {
                GeneratedDocument.CreatePackage(stream);

                var testEntities = new TestEntities(stream);

                testEntities.EditElements(stream, Log);
                testEntities.VerifyElements(stream, Log);
            }
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Creates a base Word file for the tests
        /// </summary>
        /// <param name="createFilePath">Create Word file path</param>
        private void Initialize(string createFilePath)
        {
            try
            {
                GeneratedDocument generatedDocument = new GeneratedDocument();
                generatedDocument.CreatePackage(createFilePath);

                this.Log.Pass("Create Power Point file. File path=[{0}]", createFilePath);
            }
            catch (Exception e)
            {
                this.Log.Fail(string.Format(e.Message + ". :File path={0}", createFilePath));
            }
        }
Ejemplo n.º 18
0
 public static GeneratedDocumentDomain ToDomainModel(this GeneratedDocument obj)
 {
     return(obj == null ? null : new GeneratedDocumentDomain()
     {
         Id = obj.GeneratedDocumentId,
         Name = obj.Name,
         ExternalId = obj.ExternalId,
         Success = obj.Success,
         DateCreated = obj.DateCreated,
         Content = null,
         TemplateVersionId = obj.TemplateVersionId,
         DocumentType = obj.DocumentType.ToDomainModel()
     });
 }
Ejemplo n.º 19
0
        /// <summary>
        /// Creates a base Power Point file for the tests
        /// </summary>
        /// <param name="createFilePath">Create Power Point file path</param>
        private void Initialize(string createFilePath)
        {
            try
            {
                GeneratedDocument generatedDocument = new GeneratedDocument();
                generatedDocument.CreatePackage(createFilePath);

                this.testEntities = new TestEntities(createFilePath);
            }
            catch (Exception e)
            {
                this.Log.Fail(string.Format(e.Message + ". :File path={0}", createFilePath));
            }
        }
Ejemplo n.º 20
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);
            }
        }
Ejemplo n.º 21
0
        public void ThreadingInfo03DeleteAddElement()
        {
            using (var stream = new MemoryStream())
            {
                GeneratedDocument.CreatePackage(stream);

                var testEntities = new TestEntities(stream);
                testEntities.DeleteElements(stream, Log);
                testEntities.VerifyDeleteElements(stream, Log);

                testEntities.AddElements(stream, Log);
                testEntities.VerifyAddElements(stream, Log);
            }
        }
Ejemplo n.º 22
0
        public void TimeLineEditAttributes()
        {
            using (var ms = new MemoryStream())
            {
                GeneratedDocument.CreatePackage(ms);

                var testEntities = new TestEntities(ms);
                testEntities.EditAttributes(ms);
                testEntities.VerifyEditedAttribute(ms);

                testEntities.DeleteTimelineStyle(ms);
                testEntities.VerifyDeletedTimelineStyle(ms);

                testEntities.AddTimelineStyle(ms);
                testEntities.VerifyAddedTimelineStyle(ms);
            }
        }
Ejemplo n.º 23
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);
            }
        }
Ejemplo n.º 24
0
        public static GeneratedDocument FromDomainModel(this GeneratedDocument obj, GeneratedDocumentDomain domain)
        {
            if (obj == null)
            {
                obj = new GeneratedDocument();
            }

            obj.GeneratedDocumentId = domain.Id;
            obj.Name              = domain.Name;
            obj.ExternalId        = domain.ExternalId;
            obj.Success           = domain.Success;
            obj.DateCreated       = domain.DateCreated;
            obj.Content           = domain.Content;
            obj.TemplateVersionId = domain.TemplateVersionId;
            obj.DocumentTypeId    = domain.DocumentTypeId;

            return(obj);
        }
Ejemplo n.º 25
0
        public void ContentControl03DeleteElement()
        {
            using (var stream = new MemoryStream())
            {
                GeneratedDocument.CreatePackage(stream);

                using (var package = WordprocessingDocument.Open(stream, true))
                {
                    foreach (var sdtElement in package.MainDocumentPart.Document.Descendants <SdtElement>().Reverse())
                    {
                        sdtElement.Remove();
                    }
                }

                using (var package = WordprocessingDocument.Open(stream, false))
                {
                    Assert.Empty(package.MainDocumentPart.Document.Descendants <SdtElement>());
                }
            }
        }
Ejemplo n.º 26
0
 public void AddToGeneratedDocumentSet(GeneratedDocument generatedDocument)
 {
     base.AddObject("GeneratedDocumentSet", generatedDocument);
 }
Ejemplo n.º 27
0
 public static GeneratedDocument CreateGeneratedDocument(int ID, byte[] rowVersion)
 {
     GeneratedDocument generatedDocument = new GeneratedDocument();
     generatedDocument.Id = ID;
     generatedDocument.RowVersion = rowVersion;
     return generatedDocument;
 }