-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
6 changed files
with
128 additions
and
46 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
module org.meeuw.i18n.languages { | ||
requires java.validation; | ||
requires lombok; | ||
|
||
exports org.meeuw.i18n.languages; | ||
} |
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
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
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
29 changes: 29 additions & 0 deletions
29
src/test/java/org/meeuw/i18n/languages/LanguageCodeTest.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 |
---|---|---|
@@ -1,12 +1,41 @@ | ||
package org.meeuw.i18n.languages; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import org.junit.jupiter.api.Test; | ||
|
||
@SuppressWarnings("OptionalGetWithoutIsPresent") | ||
class LanguageCodeTest { | ||
|
||
@Test | ||
public void stream() { | ||
LanguageCode.stream().forEach(System.out::println); | ||
} | ||
|
||
@Test | ||
public void get() { | ||
assertThat(LanguageCode.getByCode("nld").get().getRefName()).isEqualTo("Dutch"); | ||
} | ||
|
||
@Test | ||
public void getByPart1() { | ||
assertThat(LanguageCode.getByPart1("nl").get().getRefName()).isEqualTo("Dutch"); | ||
} | ||
|
||
@Test | ||
public void getByPart2T() { | ||
assertThat(LanguageCode.getByPart2T("nld").get().getRefName()).isEqualTo("Dutch"); | ||
} | ||
|
||
@Test | ||
public void getByPart2B() { | ||
assertThat(LanguageCode.getByPart2B("dut").get().getRefName()).isEqualTo("Dutch"); | ||
} | ||
|
||
@Test | ||
public void getUnknown() { | ||
assertThat(LanguageCode.getByCode("doesntexist")).isEmpty(); | ||
} | ||
|
||
|
||
|
||
} |