public void GlobalReferenceExpressionTest()
 {
     CSharpParser parser = new CSharpParser();
     parser.ParseTypeReference(new StringReader("global::System"));
     //Assert.IsTrue(tre.TypeReference.IsGlobal);
     //Assert.AreEqual("System", tre.TypeReference.Type);
     throw new NotImplementedException();
 }
 public AstType ParseTypeReference(string content)
 {
     try {
         using (var reader = new StringReader(content.Trim())) {
             var parser = new CSharpParser();
             return(parser.ParseTypeReference(reader));
         }
     } catch {
         return(null);
     }
 }
		public void GlobalReferenceExpressionTest()
		{
			CSharpParser parser = new CSharpParser();
			AstType type = parser.ParseTypeReference(new StringReader("global::System"));
			Assert.IsNotNull(
				new MemberType {
					Target = new SimpleType("global"),
					IsDoubleColon = true,
					MemberName = "System"
				}.Match(type)
			);
		}
Exemplo n.º 4
0
        public void GlobalReferenceExpressionTest()
        {
            CSharpParser parser = new CSharpParser();
            AstType      type   = parser.ParseTypeReference(new StringReader("global::System"));

            Assert.IsTrue(
                new MemberType {
                Target        = new SimpleType("global"),
                IsDoubleColon = true,
                MemberName    = "System"
            }.IsMatch(type)
                );
        }