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);
        }
Пример #3
0
        public void VisitEnumerableElement(EnumerableElement element)
        {
            EnumerableElementsCount += 1;
            IEnumerable<ITreeElement> childrens = element.GetChilds();

            foreach (var child in childrens)
            {
                child.Visit(this);
            }
        }
Пример #4
0
        public void VisitEnumerableElement(EnumerableElement element)
        {
            if (!IsNeedProcessElement(element.ValueObject))
            {
                return;
            }
            _builder.WriteStartEnumerable(element.TypeName);

            VisitChildrens(element);

            _builder.WriteEndEnumerable(element.TypeName);
        }
Пример #5
0
        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--;
        }
 public void TestValidElementType()
 {
     EnumerableElement validElement = new EnumerableElement("some_name", new List<int>());
 }
 public void TestsInvalidElementType()
 {
     EnumerableElement invalidElement = new EnumerableElement("some_name", 10.0);
 }