Ejemplo n.º 1
0
        public virtual Element FindMethodElement(Type type, string methodName)
        {
            TypeMirror mirror = _typeMirrorTestUtils.typeOf(type);

//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            return(ElementFilter.methodsIn(_types.asElement(mirror).EnclosedElements).Where(method => method.SimpleName.contentEquals(methodName)).First().orElseThrow(() => new AssertionError(string.Format("Could not find method {0} of class {1}", methodName, type.FullName))));
        }
Ejemplo n.º 2
0
 private IList <ExecutableElement> MethodsAnnotatedWith(Element returnType, Type annotationType)
 {
     return(ElementFilter.methodsIn(returnType.EnclosedElements).Where(m => m.getAnnotation(annotationType) != null).ToList());
 }