public void They_Should_Not_Show_In_The_Object_Heirarchy()
        {
            Namespace ns = new Namespace(controller) { Index = 1};
            Region region = new Region(controller, "RegionStart") { Index = 2};
            Class clazz = new Class(controller, "Class1") { Index = 3};

            region.AddChild(clazz);
            ns.AddChild(region);

            Assert.That(clazz.Parent, Is.SameAs(ns), "The parent of the Class should be the Namespace, not the Region");
        }
Ejemplo n.º 2
0
        public void They_Should_Not_Show_In_The_Fully_Qualified_Display_Name()
        {
            Namespace ns     = new Namespace(controller);
            Region    region = new Region(controller, "RegionStart");
            Class     clazz  = new Class(controller, "Class1");

            region.AddChild(clazz);
            ns.AddChild(region);

            Assert.That(clazz.FullyQualifiedDisplayName.IndexOf("RegionStart") < 0,
                        "The fully qualified display name of the Class should not contain the region name");
        }
        public void They_Should_Not_Show_In_The_Fully_Qualified_Display_Name()
        {
            Namespace ns = new Namespace(controller);
            Region region = new Region(controller, "RegionStart");
            Class clazz = new Class(controller, "Class1");

            region.AddChild(clazz);
            ns.AddChild(region);

            Assert.That(clazz.FullyQualifiedDisplayName.IndexOf("RegionStart") < 0,
                "The fully qualified display name of the Class should not contain the region name");
        }
Ejemplo n.º 4
0
        private void AddRegion(ICodeRegion region, Region parentRegion)
        {
            var r = new Region();

            r.Name       = region.Name;
            r.LineNumber = region.LineStart;
            Debug.WriteLine("Added region {0} to {1}", r.Name, this.Name);

            parentRegion.AddChild(r);

            foreach (var nestedRegion in region.NestedRegions)
            {
                AddRegion(nestedRegion, r);
            }
        }
Ejemplo n.º 5
0
        public void They_Should_Not_Show_In_The_Object_Heirarchy()
        {
            Namespace ns = new Namespace(controller)
            {
                Index = 1
            };
            Region region = new Region(controller, "RegionStart")
            {
                Index = 2
            };
            Class clazz = new Class(controller, "Class1")
            {
                Index = 3
            };

            region.AddChild(clazz);
            ns.AddChild(region);

            Assert.That(clazz.Parent, Is.SameAs(ns), "The parent of the Class should be the Namespace, not the Region");
        }
Ejemplo n.º 6
0
        private void AddRegion(ICodeRegion region, Region parentRegion)
        {
            var r = new Region();
            r.Name = region.Name;
            r.LineNumber = region.LineStart;
            Debug.WriteLine("Added region {0} to {1}", r.Name, this.Name);

            parentRegion.AddChild(r);

            foreach (var nestedRegion in region.NestedRegions)
            {
                AddRegion(nestedRegion, r);
            }

        }