From d8115407d69d5ec3b8224a184a5758bcdf3ad71b Mon Sep 17 00:00:00 2001 From: Edi Morales Date: Sat, 9 Mar 2024 20:12:45 -0600 Subject: [PATCH] Adds UT for language --- .../java/jpass/util/ConfigurationTest.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/test/java/jpass/util/ConfigurationTest.java b/src/test/java/jpass/util/ConfigurationTest.java index ded9b60..2fa2a8c 100644 --- a/src/test/java/jpass/util/ConfigurationTest.java +++ b/src/test/java/jpass/util/ConfigurationTest.java @@ -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);