Skip to content

Commit

Permalink
added InterfaceTest
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtechhabarta committed Mar 25, 2016
1 parent a692bae commit 9ef5608
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

package cz.habarta.typescript.generator;

import org.junit.Assert;
import org.junit.Test;


public class InterfaceTest {

@Test
public void test() {
final Settings settings = TestUtils.settings();
final String output = new TypeScriptGenerator(settings).generateTypeScript(Input.from(Book.class));
Assert.assertTrue(output.contains("interface Book"));
Assert.assertTrue(output.contains("title: string;"));
Assert.assertTrue(output.contains("interface Author"));
}

static interface Book {
Author getAuthor();
String getTitle();
}

static interface Author {
String getName();
}

}

0 comments on commit 9ef5608

Please sign in to comment.