private void TestMergeNodeWithAnotherNode(DDNode nDestination, DDNode.DDNODE_MERGE_OPTION option, ResolveConflict res) { var nSource = XMLDeserialize(UTestDrDataCommon.GetMemoryStreamFromFile(".\\XML\\" + UTestDrDataCommon.GetTestMethodName() + ".Source.xml")); UTestDrDataCommon.WriteMemmoryStreamToFile(XMLSerialize(nDestination), UTestDrDataCommon.GetTestMethodName() + ".Destination.xml"); UTestDrDataCommon.WriteMemmoryStreamToFile(XMLSerialize(nSource), UTestDrDataCommon.GetTestMethodName() + ".Source.xml"); nDestination.Merge(nSource, option, res); UTestDrDataCommon.WriteMemmoryStreamToFile(XMLSerialize(nDestination), UTestDrDataCommon.GetTestMethodName() + ".Actual.xml"); var nExpected = XMLDeserialize(UTestDrDataCommon.GetMemoryStreamFromFile(".\\XML\\" + UTestDrDataCommon.GetTestMethodName() + ".Expected.xml")); UTestDrDataCommon.WriteMemmoryStreamToFile(XMLSerialize(nExpected), UTestDrDataCommon.GetTestMethodName() + ".Expected.xml"); Assert.IsTrue(nDestination == nExpected, "The actual node is not equal expected node. See xml files in the bin folder."); }
public void TestMergeStockCollectionWithEmptyCollection() { var nDestination = GetStockHierarhy(); var nSource = new DDNode("Test"); UTestDrDataCommon.WriteMemmoryStreamToFile(XMLSerialize(nDestination), UTestDrDataCommon.GetTestMethodName() + ".Destination.xml"); UTestDrDataCommon.WriteMemmoryStreamToFile(XMLSerialize(nSource), UTestDrDataCommon.GetTestMethodName() + ".Source.xml"); nDestination.Merge(nSource); UTestDrDataCommon.WriteMemmoryStreamToFile(XMLSerialize(nDestination), UTestDrDataCommon.GetTestMethodName() + ".Actual.xml"); var nExpected = XMLDeserialize(UTestDrDataCommon.GetMemoryStreamFromFile(".\\XML\\" + UTestDrDataCommon.GetTestMethodName() + ".Expected.xml")); UTestDrDataCommon.WriteMemmoryStreamToFile(XMLSerialize(nExpected), UTestDrDataCommon.GetTestMethodName() + ".Expected.xml"); Assert.IsTrue(nDestination == nExpected, "The actual node is not equal expected node. See xml files in the bin folder."); }