public static void ElementsAfterSelfWithXNameBeforeAndAfter() { XText aText = new XText("a"), bText = new XText("b"); XElement a = new XElement("A", aText), b = new XElement("B", bText); a.Add(b); IEnumerable<XElement> nodes = aText.ElementsAfterSelf("B"); Assert.Equal(1, nodes.Count()); b.ReplaceWith(a); Assert.Equal(0, nodes.Count()); }
public static void ElementsAfterSelfWithXNameBeforeAndAfter() { XText aText = new XText("a"), bText = new XText("b"); XElement a = new XElement("A", aText), b = new XElement("B", bText); a.Add(b); IEnumerable <XElement> nodes = aText.ElementsAfterSelf("B"); Assert.Equal(1, nodes.Count()); b.ReplaceWith(a); Assert.Equal(0, nodes.Count()); }