Exemplo n.º 1
0
        public void FirstChild_WithNodeWithoutChildren_ShouldReturnFalseAndNotMoveCurrent()
        {
            var node = GetTagNode();
            var tree = new NodeTree(node);
            var result = tree.FirstChild();

            Assert.IsFalse(result);
            Assert.AreEqual(node, tree.Current);
        }
Exemplo n.º 2
0
        public void FirstChild_WithNodeWithChildren_ShouldReturnTrueAndMoveCurrentToCurrentsFirstChild()
        {
            var first = GetTagNode();
            var last = GetTagNode();
            var node = GetTagNodeWithChildren(first, last);
            var tree = new NodeTree(node);
            var result = tree.FirstChild();

            Assert.IsTrue(result);
            Assert.AreEqual(first, tree.Current);
        }