Skip to content

Commit

Permalink
Adds UT for language
Browse files Browse the repository at this point in the history
  • Loading branch information
edimoral committed Mar 10, 2024
1 parent 4042ed8 commit d811540
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/test/java/jpass/util/ConfigurationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,38 +44,44 @@ public void setup() {
}

@Test
public void configurationIsDarkModeEnabledTest() {
void configurationIsDarkModeEnabledTest() {
Boolean result = configuration.is("ui.theme.dark.mode.enabled", false);
assertFalse(result);
}

@Test
public void configurationGetIntegerClearClipboardOnExitWrongConfigTest() {
void configurationGetIntegerClearClipboardOnExitWrongConfigTest() {
int result = configuration.getInteger("clear.clipboard.on.exit.enabled", 0);
assertEquals(0, result);
}

@Test
public void configurationIsDefaultPasswordGenerationNullConfigTest() {
void configurationIsDefaultPasswordGenerationNullConfigTest() {
Boolean result = configuration.is("default.password.generation.size", false);
assertFalse(result);
}

@Test
public void configurationGetDateFormatTest() {
void configurationGetDateFormatTest() {
String result = configuration.get("date.format", "yyyy-MM-dd");
assertEquals("yyyy-MM-dd", result);
}

@Test
public void configurationGetArrayEntryDetailsTest() {
void configurationGetLanguageTest() {
String result = configuration.get("language.languageSetting", "en-US");
assertEquals("en-US", result);
}

@Test
void configurationGetArrayEntryDetailsTest() {
String[] defaultValue = new String[]{"TITLE", "MODIFIED"};
String[] result = configuration.getArray("entry.details", defaultValue);
assertArrayEquals(defaultValue, result);
}

@Test
public void configurationGetArrayEntryDetailsWrongKeyTest() {
void configurationGetArrayEntryDetailsWrongKeyTest() {
String[] defaultValue = new String[]{"TITLE", "MODIFIED"};
String[] result = configuration.getArray("entry.detail", defaultValue);
assertArrayEquals(defaultValue, result);
Expand Down

0 comments on commit d811540

Please sign in to comment.