/// <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); }
/// <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); }
/// <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); }
/// <summary> /// Constructor /// </summary> public ChartTrackingRefBasedTest(ITestOutputHelper output) : base(output) { string createFilePath = GetTestFilePath(generateDocumentFile); GeneratedDocument generatedDocument = new GeneratedDocument(); generatedDocument.CreatePackage(createFilePath); testEntities = new TestEntities(createFilePath); }
public void ContentControl01EditElement() { using (var stream = new MemoryStream()) { GeneratedDocument.CreatePackage(stream); EditElement.EditContentControlElements(stream, Log); VerifyElement.VerifyContentControlElement(stream, Log); } }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
public void CommentEx04VerifyDelete() { using (var stream = new MemoryStream()) { GeneratedDocument.Generate(stream); TestEntities.DeleteElements(stream); TestEntities.VerifyDeletedElements(stream); } }
public void CommentEx02VerifyEdit() { using (var stream = new MemoryStream()) { GeneratedDocument.Generate(stream); TestEntities.EditElements(stream); TestEntities.VerifyElements(stream); } }
public void CommentExPeople01ReadElement() { using (var stream = new MemoryStream()) { GeneratedDocument generatedDocument = new GeneratedDocument(); generatedDocument.CreatePackage(stream); TestEntities testEntities = new TestEntities(); testEntities.ReadElements(stream, Log); } }
public void Slicer01EditElement() { using (var stream = new MemoryStream()) { GeneratedDocument.CreatePackage(stream); TestEntities testEntities = new TestEntities(); testEntities.EditElements(stream, Log); testEntities.VerifyElements(stream, Log); } }
/// <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); }
/// <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); } }
/// <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)); } }
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() }); }
/// <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)); } }
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); } }
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); } }
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); } }
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 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); }
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>()); } } }
public void AddToGeneratedDocumentSet(GeneratedDocument generatedDocument) { base.AddObject("GeneratedDocumentSet", generatedDocument); }
public static GeneratedDocument CreateGeneratedDocument(int ID, byte[] rowVersion) { GeneratedDocument generatedDocument = new GeneratedDocument(); generatedDocument.Id = ID; generatedDocument.RowVersion = rowVersion; return generatedDocument; }