From a7a97689ba5d4e530c0f7ec3c1602a5d94dbc329 Mon Sep 17 00:00:00 2001 From: "Kai.Yuan" Date: Sat, 3 Feb 2024 00:28:22 +0100 Subject: [PATCH] [count-upper-lower] add unicode char tests --- .../CountUpperAndLowercaseCharsUnitTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core-java-modules/core-java-string-operations-8/src/test/java/com/baeldung/countupperandlowercasechars/CountUpperAndLowercaseCharsUnitTest.java b/core-java-modules/core-java-string-operations-8/src/test/java/com/baeldung/countupperandlowercasechars/CountUpperAndLowercaseCharsUnitTest.java index b1ed82ea34..9137906a5a 100644 --- a/core-java-modules/core-java-string-operations-8/src/test/java/com/baeldung/countupperandlowercasechars/CountUpperAndLowercaseCharsUnitTest.java +++ b/core-java-modules/core-java-string-operations-8/src/test/java/com/baeldung/countupperandlowercasechars/CountUpperAndLowercaseCharsUnitTest.java @@ -3,6 +3,7 @@ package com.baeldung.countupperandlowercasechars; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class CountUpperAndLowercaseCharsUnitTest { private static final String MY_STRING = "Hi, Welcome to Baeldung! Let's count letters!"; @@ -50,6 +51,13 @@ public class CountUpperAndLowercaseCharsUnitTest { assertEquals(4, result.getUppercaseCount()); assertEquals(31, result.getLowercaseCount()); } + + + @Test + void whenUsingIsUpperCaseAndIsLowerCase_thenUnicodeCharactersCanBeChecked() { + assertTrue(Character.isLowerCase('ä')); + assertTrue(Character.isUpperCase('Ä')); + } } class LetterCount {