public void TestGetChildrensCount()
        {
            EnumerableElement enumElement = new EnumerableElement("name", someList);
            IEnumerable<ITreeElement> childrens = enumElement.GetChilds();

            Assert.AreEqual(4, childrens.Count());
        }
        public void TestGetChildensElements()
        {
            EnumerableElement enumElement = new EnumerableElement("name", someList);
            IEnumerable<ITreeElement> childrens = enumElement.GetChilds();

            Assert.AreEqual((childrens.First() as BaseElement).ValueObject, 10);
            Assert.IsTrue(childrens.Last() is MCSClassElement);
        }
        public void VisitEnumerableElement(EnumerableElement element)
        {
            EnumerableElementsCount += 1;
            IEnumerable<ITreeElement> childrens = element.GetChilds();

            foreach (var child in childrens)
            {
                child.Visit(this);
            }
        }
        public void VisitEnumerableElement(EnumerableElement element)
        {
            if (_visited.ContainsKey(element.ValueObject))
            {
                return;
            }

            _visited.Add(element.ValueObject, true);

            depth++;
            IEnumerable<ITreeElement> childrens = element.GetChilds();

            for (int i = 0; i < depth; ++i)
            {
                _writer.Write("  ");
            }
            _writer.WriteLine("Name: {0}", element.Name);

            foreach (var child in childrens)
            {
                child.Visit(this);
            }
            depth--;
        }