-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a692bae
commit 9ef5608
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
typescript-generator-core/src/test/java/cz/habarta/typescript/generator/InterfaceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
|
||
} |