示例#1
0
 public static IMethodName Method([NotNull] string input)
 {
     try
     {
         var ctx = TypeNameParseUtil.ValidateMethodName(input);
         if (ctx.UNKNOWN() != null)
         {
             return(UnknownName.Get(typeof(IMethodName)));
         }
         return(new MethodName(ctx));
     }
     catch (Exception)
     {
         try
         {
             var ctx = TypeNameParseUtil.ValidateMethodName(CsNameFixer.HandleOldMethodNames(input));
             if (ctx.UNKNOWN() != null)
             {
                 return(UnknownName.Get(typeof(IMethodName)));
             }
             return(new MethodName(ctx));
         }
         catch (Exception)
         {
             return(UnknownName.Get(typeof(IMethodName)));
         }
     }
 }
示例#2
0
 public void HandleNotNamedDelegates(string input, string expected)
 {
     Assert.AreEqual(expected, CsNameFixer.HandleOldTypeNames(input));
 }
示例#3
0
 public void HandleArrayTypeIdentifier(string input, string expected)
 {
     Assert.AreEqual(expected, CsNameFixer.HandleOldTypeNames(input));
 }
示例#4
0
 public void HandleNestedTypeIdentifier(string input, string expected)
 {
     Assert.AreEqual(expected, CsNameFixer.HandleNestedTypeNames(CsNameFixer.HandleTypeIdentifier(input)));
 }
示例#5
0
 public void HandleOldMethodNames(string input, string expected)
 {
     Assert.AreEqual(expected, CsNameFixer.HandleOldMethodNames(input));
 }
示例#6
0
 public void HandleOldNamesSimpleNested(string input, string expected)
 {
     Assert.AreEqual(expected, CsNameFixer.HandleOldTypeNames(input));
 }