From 58de7ebb1744bc77f48c1f64645e3a611d1280ac Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 10 Apr 2016 20:50:37 +0100 Subject: Write type parameters for interface methods --- .../tests/backends/csharp/CsharpSerializerTests.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/test') diff --git a/src/test/java/org/zwobble/couscous/tests/backends/csharp/CsharpSerializerTests.java b/src/test/java/org/zwobble/couscous/tests/backends/csharp/CsharpSerializerTests.java index 991ec79..d7cce40 100644 --- a/src/test/java/org/zwobble/couscous/tests/backends/csharp/CsharpSerializerTests.java +++ b/src/test/java/org/zwobble/couscous/tests/backends/csharp/CsharpSerializerTests.java @@ -491,6 +491,23 @@ public class CsharpSerializerTests { assertEquals("namespace com.example {\n internal interface Example {\n X get();\n }\n}\n", output); } + @Test + public void interfaceWithMethodWithTypeParameters() { + MethodNode method = MethodNode.staticMethod("nothing") + .typeParameter(formalTypeParameter(Identifiers.method(Identifiers.forType("com.Example.example"), "nothing"), "T")) + .typeParameter(formalTypeParameter(Identifiers.method(Identifiers.forType("com.Example.example"), "nothing"), "U")) + .returns(ScalarType.of("void")) + .build(); + + Node node = new ClassNodeBuilder(ScalarType.of("com.example.Example")) + .method(method) + .buildInterface(); + + String output = serialize(node); + + assertEquals("namespace com.example {\n internal interface Example {\n void nothing();\n }\n}\n", output); + } + @Test public void enumWithSimpleValues() { Node node = declareEnum(ScalarType.of("com.example.Example"), list("ONE", "TWO")); -- cgit v1.2.3