public void GetRecord_GoodRecordInfo_ReturnsRecord() { var docA = new XmlDocument(); docA.LoadXml(@"<doc><test id='2'>a</test></doc>"); var docX = new XmlDocument(); docX.LoadXml(@"<doc><test id='2'>x</test></doc>"); var docY = new XmlDocument(); docY.LoadXml(@"<doc><test id='2'>y</test></doc>"); var situation = new MergeSituation("ARelativePath", "x", "x1", "y", "y1",MergeOrder.ConflictHandlingModeChoices.WeWin); var conflict = new BothEditedTextConflict(docX.SelectSingleNode("doc/test"), docY.SelectSingleNode("doc/test"), docA.SelectSingleNode("doc/test"), situation, "theWinner"); conflict.Context = new ContextDescriptor("dummy","//test[@id='2']"); var retriever = new DummyXmlRetriever(docA,docX, docY); var result = conflict.GetConflictingRecordOutOfSourceControl(retriever, ThreeWayMergeSources.Source.UserX); Assert.AreEqual("<test id=\"2\">x</test>", result); }
public void GetRecord_GoodRecordInfo_ReturnsRecord() { var docA = new XmlDocument(); docA.LoadXml(@"<doc><test id='2'>a</test></doc>"); var docX = new XmlDocument(); docX.LoadXml(@"<doc><test id='2'>x</test></doc>"); var docY = new XmlDocument(); docY.LoadXml(@"<doc><test id='2'>y</test></doc>"); var situation = new MergeSituation("ARelativePath", "x", "x1", "y", "y1", MergeOrder.ConflictHandlingModeChoices.WeWin); var conflict = new BothEditedTextConflict(docX.SelectSingleNode("doc/test"), docY.SelectSingleNode("doc/test"), docA.SelectSingleNode("doc/test"), situation, "theWinner"); conflict.Context = new ContextDescriptor("dummy", "//test[@id='2']"); var retriever = new DummyXmlRetriever(docA, docX, docY); var result = conflict.GetConflictingRecordOutOfSourceControl(retriever, ThreeWayMergeSources.Source.UserX); Assert.AreEqual("<test id=\"2\">x</test>", result); }