예제 #1
0
        public void CanVisitAssemblyDefinition()
        {
            var visitor = new TracingVisitor();

            ThisAssembly.Accept(visitor);

            Assert.IsTrue(visitor.HasTouched(ThisAssembly));
        }
예제 #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))));
        }
예제 #3
0
        public void CanVisitGenericParameters()
        {
            var visitor = new TracingVisitor();

            ThisAssembly.Accept(visitor);

            Assert.IsTrue(visitor.HasTouchedAll(ThisGeneric.GenericParameters));
        }
예제 #4
0
        public void CanVisitFieldDefinitions()
        {
            var visitor = new TracingVisitor();

            ThisAssembly.Accept(visitor);

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

            ThisAssembly.Accept(visitor);

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

            ThisAssembly.Accept(visitor);

            Assert.IsTrue(visitor.HasTouched(ThisFixtureType.BaseType));
            Assert.IsTrue(visitor.HasTouched(ThisNestedType.BaseType));
        }
예제 #7
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())));
        }
예제 #8
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));
        }
예제 #9
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));
        }
예제 #10
0
 public void DontCrashWithNullVisitor()
 {
     ThisAssembly.Accept(null);
 }