예제 #1
0
        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());
        }
예제 #2
0
 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());
 }