public static void AncestorsWithXNameBeforeAndAfter() { 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 = bText.Ancestors("B"); Assert.Equal(1, nodes.Count()); bText.Remove(); a.Add(bText); Assert.Equal(0, nodes.Count()); }
public static void AncestorsWithXNameBeforeAndAfter() { 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 = bText.Ancestors("B"); Assert.Equal(1, nodes.Count()); bText.Remove(); a.Add(bText); Assert.Equal(0, nodes.Count()); }