public static void ElementsBeforeSelfWithXNameBeforeAndAfter() { XText aText = new XText("a"), bText = new XText("b"); XElement a = new XElement("A", aText), b = new XElement("B", bText); aText.AddBeforeSelf(b); IEnumerable <XElement> nodes = aText.ElementsBeforeSelf("B"); Assert.Equal(1, nodes.Count()); b.Remove(); Assert.Equal(0, nodes.Count()); }
public static void ElementsBeforeSelfWithXNameBeforeAndAfter() { XText aText = new XText("a"), bText = new XText("b"); XElement a = new XElement("A", aText), b = new XElement("B", bText); aText.AddBeforeSelf(b); IEnumerable<XElement> nodes = aText.ElementsBeforeSelf("B"); Assert.Equal(1, nodes.Count()); b.Remove(); Assert.Equal(0, nodes.Count()); }