예제 #1
0
 public void FullNameTypeLookup()
 {
     var type = new MemberTypeReference(new SimpleTypeReference("System"), new Identifier("Math"));
     var result = type.Resolve(_compilationUnit.GetScope());
     Assert.IsInstanceOfType(result, typeof(MemberResolveResult));
     Assert.IsInstanceOfType(result.ScopeProvider, typeof(TypeDefinition));
     Assert.AreEqual("System.Math", ((TypeDefinition)result.ScopeProvider).FullName);
 }
예제 #2
0
 public void NestedTypeLookupThroughUsing()
 {
     _compilationUnit.UsingDirectives.Add(new UsingNamespaceDirective("System"));
     var type = new MemberTypeReference(new SimpleTypeReference("Environment"), new Identifier("SpecialFolder"));
     var result = type.Resolve(_compilationUnit.GetScope());
     Assert.IsInstanceOfType(result, typeof(MemberResolveResult));
     Assert.IsInstanceOfType(result.ScopeProvider, typeof(TypeDefinition));
     Assert.AreEqual("System.Environment+SpecialFolder", ((TypeDefinition)result.ScopeProvider).FullName);
 }