Exemple #1
0
        public void find_next_going_up_two_levels_to_do_so()
        {
            a.AppendChild(b);
            b.AppendChild(c);
            a.InsertAfter(d);

            c.FindNext().ShouldEqual(d);
        }
Exemple #2
0
        public void find_index_walks_up_top()
        {
            a.AppendChild(b);
            b.AppendChild(c);
            c.AppendChild(d);
            d.AppendChild(e);

            e.FindIndex().ShouldEqual(a);
            d.FindIndex().ShouldEqual(a);
            c.FindIndex().ShouldEqual(a);
            b.FindIndex().ShouldEqual(a);

            a.FindIndex().ShouldBeNull();
        }
Exemple #3
0
        public void append_one_child()
        {
            a.AppendChild(b);

            a.FirstChild.ShouldBeTheSameAs(b);
            a.LastChild.ShouldBeTheSameAs(b);
            a.ChildNodes.ShouldHaveTheSameElementsAs(b);

            b.Parent.ShouldBeTheSameAs(a);
            b.NextSibling.ShouldBeNull();
            b.PreviousSibling.ShouldBeNull();
        }