public void DiffDifferentTest() { const string f_alt = @"diff-b1.xml"; const string f_neu = @"diff-b2.xml"; Knoten alt = Knoten.createOf(createDOM(XmlReader.Create(f_alt))); Knoten neu = Knoten.createOf(createDOM(XmlReader.Create(f_neu))); DiffEngine diff = new DiffEngine(); Knoten res = diff.Diff(alt, neu); Assert.IsNotNull(res); Assert.AreEqual( "<fucc>" + "<property name=\"launch\">" + "<!-- ADDED: hinzugefuegt (aslkdfh) -->" + "</property>" + "<program name=\"\">" + "<argument startsWith=\"\">" + "<dir recursive=\"false\" type=\"files\">" + "<!-- REMOVED: match (.+\\.(cmd|exe|lnk|bat)) -->" + "<!-- ADDED: match (sdf.+\\.(cmd|exe|lnk|bat)) -->" + "</dir>" + "<!-- REMOVED: pathenv () -->" + "<!-- ADDED: pathenb () -->" + "</argument>" + "</program>" + "<!-- REMOVED: alias name=\"gt\" appendParams=\"true\" () -->" + "</fucc>", res.ToString()); }
public void DiffEqualShortTest() { const string xml = "<xml><hallo/></xml>"; Knoten alt = Knoten.createOf(createDOM(XmlReader.Create(xml.ToStream()))); Knoten neu = Knoten.createOf(createDOM(XmlReader.Create(xml.ToStream()))); DiffEngine diff = new DiffEngine(); Knoten res = diff.Diff(alt, neu); Assert.IsNull(res); }
public void DiffEqualTest() { const string f_alt = @"diff-b1.xml"; Knoten alt = Knoten.createOf(createDOM(XmlReader.Create(f_alt))); Knoten neu = Knoten.createOf(createDOM(XmlReader.Create(f_alt))); DiffEngine diff = new DiffEngine(); Knoten res = diff.Diff(alt, neu); Assert.IsNull(res); }
public void DiffAddedTest() { const string f_alt = @"diff-d1.xml"; const string f_neu = @"diff-d2.xml"; Knoten alt = Knoten.createOf(createDOM(XmlReader.Create(f_alt))); Knoten neu = Knoten.createOf(createDOM(XmlReader.Create(f_neu))); DiffEngine diff = new DiffEngine(); Knoten res = diff.Diff(alt, neu); Assert.IsNotNull(res); Assert.AreEqual( "<datenmodell>" + "<tabellen>" + "<table>" + "<columns><!-- ADDED: column () --></columns>" + "</table>" + "</tabellen>" + "</datenmodell>", res.ToString()); }