public void CanVisitModuleDefinition() { var visitor = new TracingVisitor(); ThisModule.Accept(visitor); Assert.IsTrue(visitor.HasTouched(ThisModule)); }
public void CanVisitMethodParameters() { var visitor = new TracingVisitor(); ThisAssembly.Accept(visitor); Assert.IsTrue(visitor.HasTouchedAll(ThisModule.Types.SelectMany(t => t.Methods.SelectMany(m => m.Parameters)))); }
public void CanVisitAssemblyDefinition() { var visitor = new TracingVisitor(); ThisAssembly.Accept(visitor); Assert.IsTrue(visitor.HasTouched(ThisAssembly)); }
public void CanVisitGenericParameters() { var visitor = new TracingVisitor(); ThisAssembly.Accept(visitor); Assert.IsTrue(visitor.HasTouchedAll(ThisGeneric.GenericParameters)); }
public void CanVisitEventDefinitions() { var visitor = new TracingVisitor(); ThisFixtureType.Accept(visitor); Assert.IsTrue(visitor.HasTouchedAll(ThisFixtureType.Events)); }
public void CanVisitFieldDefinitions() { var visitor = new TracingVisitor(); ThisAssembly.Accept(visitor); Assert.IsTrue(visitor.HasTouchedAll(ThisFixtureType.Fields)); Assert.IsTrue(visitor.HasTouchedAll(ThisNestedType.Fields)); }
public void CanVisitInterfaces() { var visitor = new TracingVisitor(); ThisAssembly.Accept(visitor); Assert.IsTrue(visitor.HasTouchedAll(ThisFixtureType.Interfaces)); Assert.IsTrue(visitor.HasTouchedAll(ThisNestedType.Interfaces)); }
public void CanVisitBaseTypes() { var visitor = new TracingVisitor(); ThisAssembly.Accept(visitor); Assert.IsTrue(visitor.HasTouched(ThisFixtureType.BaseType)); Assert.IsTrue(visitor.HasTouched(ThisNestedType.BaseType)); }
public void CanVisitTypeDefinition() { var visitor = new TracingVisitor(); var fixtureType = ThisFixtureType; fixtureType.Accept(visitor); Assert.IsTrue(visitor.HasTouched(fixtureType)); }
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()))); }
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)); }
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)); }
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()); }