//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldHandleGenericReturnType() public virtual void ShouldHandleGenericReturnType() { // GIVEN TypeReference owner = typeReference(typeof(ByteCodeUtilsTest)); MethodDeclaration declaration = MethodDeclaration.Method(typeParameter("T"), "fail").parameterizedWith("T", extending(typeof(object))).build(owner); // WHEN string desc = desc(declaration); string signature = signature(declaration); // THEN assertThat(desc, equalTo("()Ljava/lang/Object;")); assertThat(signature, equalTo("<T:Ljava/lang/Object;>()TT;")); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldHandleGenericThrows() public virtual void ShouldHandleGenericThrows() { // GIVEN TypeReference owner = typeReference(typeof(ByteCodeUtilsTest)); MethodDeclaration declaration = MethodDeclaration.Method(typeof(void), "fail", param(TypeReference.ParameterizedType(typeof(CodeGenerationTest.Thrower), typeParameter("E")), "thrower")).parameterizedWith("E", extending(typeof(Exception))).throwsException(typeParameter("E")).build(owner); // WHEN string signature = signature(declaration); string[] exceptions = exceptions(declaration); // THEN assertThat(signature, equalTo("<E:Ljava/lang/Exception;>(Lorg/neo4j/codegen/CodeGenerationTest$Thrower<TE;>;)V^TE;")); assertThat(exceptions, equalTo(new string[] { "java/lang/Exception" })); }
internal override MethodDeclaration.Builder declaration() { return(MethodDeclaration.Method(_returnType, _name, _parameters)); }