Example #1
0
        public void CanVisitModuleDefinition()
        {
            var visitor = new TracingVisitor();

            ThisModule.Accept(visitor);

            Assert.IsTrue(visitor.HasTouched(ThisModule));
        }
Example #2
0
        public void CanVisitMethodParameters()
        {
            var visitor = new TracingVisitor();

            ThisAssembly.Accept(visitor);

            Assert.IsTrue(visitor.HasTouchedAll(ThisModule.Types.SelectMany(t => t.Methods.SelectMany(m => m.Parameters))));
        }
Example #3
0
        public void CanVisitAssemblyDefinition()
        {
            var visitor = new TracingVisitor();

            ThisAssembly.Accept(visitor);

            Assert.IsTrue(visitor.HasTouched(ThisAssembly));
        }
Example #4
0
        public void CanVisitGenericParameters()
        {
            var visitor = new TracingVisitor();

            ThisAssembly.Accept(visitor);

            Assert.IsTrue(visitor.HasTouchedAll(ThisGeneric.GenericParameters));
        }
Example #5
0
        public void CanVisitEventDefinitions()
        {
            var visitor = new TracingVisitor();

            ThisFixtureType.Accept(visitor);

            Assert.IsTrue(visitor.HasTouchedAll(ThisFixtureType.Events));
        }
Example #6
0
        public void CanVisitFieldDefinitions()
        {
            var visitor = new TracingVisitor();

            ThisAssembly.Accept(visitor);

            Assert.IsTrue(visitor.HasTouchedAll(ThisFixtureType.Fields));
            Assert.IsTrue(visitor.HasTouchedAll(ThisNestedType.Fields));
        }
Example #7
0
        public void CanVisitInterfaces()
        {
            var visitor = new TracingVisitor();

            ThisAssembly.Accept(visitor);

            Assert.IsTrue(visitor.HasTouchedAll(ThisFixtureType.Interfaces));
            Assert.IsTrue(visitor.HasTouchedAll(ThisNestedType.Interfaces));
        }
Example #8
0
        public void CanVisitBaseTypes()
        {
            var visitor = new TracingVisitor();

            ThisAssembly.Accept(visitor);

            Assert.IsTrue(visitor.HasTouched(ThisFixtureType.BaseType));
            Assert.IsTrue(visitor.HasTouched(ThisNestedType.BaseType));
        }
Example #9
0
        public void CanVisitTypeDefinition()
        {
            var visitor     = new TracingVisitor();
            var fixtureType = ThisFixtureType;

            fixtureType.Accept(visitor);

            Assert.IsTrue(visitor.HasTouched(fixtureType));
        }
Example #10
0
        public void CanVisitComposedTypes()
        {
            var visitor = new TracingVisitor();

            ThisAssembly.Accept(visitor);

            Assert.IsTrue(visitor.HasTouchedAll(ThisComposedTypes.Fields.Select(f => f.FieldType)));
            Assert.IsTrue(visitor.HasTouchedAll(ThisComposedTypes.Fields.Select(f => f.FieldType.GetElementType())));
        }
Example #11
0
        public void CanVisitTypeDefinitionsInTree()
        {
            var visitor = new TracingVisitor();

            ThisAssembly.Accept(visitor);

            Assert.IsTrue(visitor.HasTouched(ThisAssembly));
            Assert.IsTrue(visitor.HasTouched(ThisModule));
            Assert.IsTrue(visitor.HasTouched(ThisFixtureType));
        }
Example #12
0
        public void CanVisitMethodDefinitions()
        {
            var visitor = new TracingVisitor();

            ThisAssembly.Accept(visitor);

            Assert.IsTrue(visitor.HasTouchedAll(ThisFixtureType.Methods));
            Assert.IsTrue(visitor.HasTouchedAll(ThisNestedType.Methods));
            Assert.IsTrue(visitor.HasTouchedAll(ThisEmptyInterface.Methods));
        }
Example #13
0
        public void CanVisitMscorlib()
        {
            var visitor = new TracingVisitor();

            MSCorlibAssembly.Accept(visitor);

            // TODO shitty test, but better than nothing - I have to catch the flight now

            Assert.AreEqual(2783, visitor.Touched.OfType <TypeDefinition>().Count());
            Assert.AreEqual(25362, visitor.Touched.OfType <TypeReference>().Count());
            Assert.AreEqual(12632, visitor.Touched.OfType <FieldDefinition>().Count());
            Assert.AreEqual(12454, visitor.Touched.OfType <CustomAttribute>().Count());
        }