Ejemplo n.º 1
0
        public void TestGetChildrensCountWithSystemNamespace()
        {
            Testdata.ClassB someClass = new Testdata.ClassB();
            MCSClassElement simpleElement = new MCSClassElement("some_name", someClass);
            IEnumerable<ITreeElement> childrens = simpleElement.GetChilds();

            Assert.AreEqual(3, childrens.Count());
        }
Ejemplo n.º 2
0
        public void TestGetChildrensCountWithMonoNamespace()
        {
            Mono.CSharp.ClassB someClass = new Mono.CSharp.ClassB();
            MCSClassElement simpleElement = new MCSClassElement("someClass", someClass);
            IEnumerable<ITreeElement> childrens = simpleElement.GetChilds();

            Assert.AreEqual(3, childrens.Count());
        }
Ejemplo n.º 3
0
        public void TestGetChildrensGetElementsTypes()
        {
            Mono.CSharp.ClassB someClass = new Mono.CSharp.ClassB();
            MCSClassElement simpleElement = new MCSClassElement("someClass", someClass);

            IEnumerable<ITreeElement> childrens = simpleElement.GetChilds();

            Assert.IsTrue(childrens.First() is SystemElement);
            Assert.IsTrue(childrens.Last() is MCSClassElement);
        }
Ejemplo n.º 4
0
        public void TestGetChildrensGetElementsNames()
        {
            Mono.CSharp.ClassB someClass = new Mono.CSharp.ClassB();
            MCSClassElement simpleElement = new MCSClassElement("someClass", someClass);

            IEnumerable<ITreeElement> childrens = simpleElement.GetChilds();

            Assert.AreEqual("aIntegerValue", childrens.First().Name);
            Assert.AreEqual("cClassAValue", childrens.Last().Name);
        }
Ejemplo n.º 5
0
        public void VisitMCSClassElement(MCSClassElement element)
        {
            MCSCLassElementsCount += 1;
            IEnumerable<ITreeElement> childrens = element.GetChilds();

            foreach (var child in childrens)
            {
                child.Visit(this);
            }
        }
Ejemplo n.º 6
0
        public void VisitMCSClassElement(MCSClassElement element)
        {
            try
            {
                if (_visited.ContainsKey(element.ValueObject))
                {
                    return;
                }
            }
            catch
            {
                return;
            }

            _visited.Add(element.ValueObject, true);

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

            for (int i = 0; i < depth; ++i)
            {
                _writer.Write("  ");
            }

            _writer.WriteLine("Class: {0}, Name: {1}", element.TypeName, element.Name);

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

            depth--;
        }