public void PracticesMerge() { var practiceData = new PracticeMockData( "Entymology Associates of Rock Chester", new[] { "*****@*****.**", "*****@*****.**", "*****@*****.**", "*****@*****.**" }.Select(s => new PracticeManagerMockData(s)), new[] { new PhysicianMockData("*****@*****.**", "Joan", "Ann"), new PhysicianMockData("*****@*****.**", "Johnny", "Ann"), new PhysicianMockData("*****@*****.**", "Billy", "Pullman"), new PhysicianMockData("*****@*****.**", "William", "Smithers") }); var practiceFields = new List <MergeField <PracticeMockData> >(MergeFieldOps.CreateBasicField(new PracticeName()).ToCollection()); var managerFields = new List <MergeField <PracticeManagerMockData> >(MergeFieldOps.CreateBasicField(new MergeFields.PracticeManagerMergeFields.Email()).ToCollection()); var physicianFields = new List <MergeField <PhysicianMockData> >( new[] { MergeFieldOps.CreateBasicField(new MergeFields.PhysicianMergeFields.Email()), MergeFieldOps.CreateBasicField(new FirstName()), MergeFieldOps.CreateBasicField(new LastName()) }); var managersChild = new MergeDataTreeChild <PracticeMockData, PracticeManagerMockData>( "PracticeManagers", managerFields.AsReadOnly(), data => data.Managers); var physiciansChild = new MergeDataTreeChild <PracticeMockData, PhysicianMockData>("Physicians", physicianFields.AsReadOnly(), data => data.Physicians); var mergeTree = MergeDataTreeOps.CreateRowTree( practiceFields.AsReadOnly(), practiceData.ToCollection(), new List <MergeDataTreeChild <PracticeMockData> > { managersChild, physiciansChild }.AsReadOnly()); using (var templateStream = File.OpenRead(testingPracticesWordTemplatePath)) { using (var destinationStream = File.Create(getFilePath("practices_merge_test"))) { MergeOps.CreateMsWordDoc(mergeTree, true, templateStream, destinationStream); doneCreating = DateTime.Now; } } }
public void PersonMerge() { var singlePersonMergeData = new MergeTestData { FullName = "Johnny Rockets, King of the Dinosaurs", Things = new List <MergeTestData.Thing>( new[] { new MergeTestData.Thing { TheValue = "Something" }, new MergeTestData.Thing { TheValue = "Another thing" }, new MergeTestData.Thing { TheValue = "One more thing" }, new MergeTestData.Thing { TheValue = "Last thing" }, new MergeTestData.Thing { TheValue = "Okay THIS is the last thing" }, new MergeTestData.Thing { TheValue = "Something again" }, new MergeTestData.Thing { TheValue = "Another thing again" }, new MergeTestData.Thing { TheValue = "One more thing again" }, new MergeTestData.Thing { TheValue = "Last thing again" }, new MergeTestData.Thing { TheValue = "Okay THIS is the last thing again" }, new MergeTestData.Thing { TheValue = "Something one more time" }, new MergeTestData.Thing { TheValue = "Another thing one more time" }, new MergeTestData.Thing { TheValue = "One more thing one more time" }, new MergeTestData.Thing { TheValue = "Last thing one more time" }, new MergeTestData.Thing { TheValue = "Okay THIS is the last thing one more time" }, new MergeTestData.Thing { TheValue = "Something that is getting old" }, new MergeTestData.Thing { TheValue = "Another thing that is getting old" }, new MergeTestData.Thing { TheValue = "One more thing that is getting old" }, new MergeTestData.Thing { TheValue = "Last thing that is getting old" }, new MergeTestData.Thing { TheValue = "Okay THIS is the last thing that is getting old" }, new MergeTestData.Thing { TheValue = "Something about the end of all things" }, new MergeTestData.Thing { TheValue = "Another thing about the end of all things" }, new MergeTestData.Thing { TheValue = "One more thing about the end of all things" }, new MergeTestData.Thing { TheValue = "Last thing about the end of all things" }, new MergeTestData.Thing { TheValue = "Okay THIS is the last thing about the end of all things" }, }) }; var mergingInfoFields = new List <MergeField <MergeTestData> >(new[] { MergeFieldOps.CreateBasicField(new FullName()) }); var internalTableDataFields = new List <MergeField <MergeTestData.Thing> >(new[] { MergeFieldOps.CreateBasicField(new TheValue()) }); var mergeTree = MergeDataTreeOps.CreateRowTree( mergingInfoFields.AsReadOnly(), singlePersonMergeData.ToSingleElementArray(), new List <MergeDataTreeChild <MergeTestData> > { new MergeDataTreeChild <MergeTestData, MergeTestData.Thing>("Things", internalTableDataFields.AsReadOnly(), info => info.Things) }.AsReadOnly()); using (var templateStream = File.OpenRead(testingWordTemplatePath)) { using (var destinationStream = File.Create(getFilePath("basic_merge_test"))) { MergeOps.CreateMsWordDoc(mergeTree, true, templateStream, destinationStream); doneCreating = DateTime.Now; } } }