Esempio n. 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)));
         }
     }
 }
Esempio n. 2
0
 public void HandleNotNamedDelegates(string input, string expected)
 {
     Assert.AreEqual(expected, CsNameFixer.HandleOldTypeNames(input));
 }
Esempio n. 3
0
 public void HandleArrayTypeIdentifier(string input, string expected)
 {
     Assert.AreEqual(expected, CsNameFixer.HandleOldTypeNames(input));
 }
Esempio n. 4
0
 public void HandleNestedTypeIdentifier(string input, string expected)
 {
     Assert.AreEqual(expected, CsNameFixer.HandleNestedTypeNames(CsNameFixer.HandleTypeIdentifier(input)));
 }
Esempio n. 5
0
 public void HandleOldMethodNames(string input, string expected)
 {
     Assert.AreEqual(expected, CsNameFixer.HandleOldMethodNames(input));
 }
Esempio n. 6
0
 public void HandleOldNamesSimpleNested(string input, string expected)
 {
     Assert.AreEqual(expected, CsNameFixer.HandleOldTypeNames(input));
 }