Add tests for UnicodeLetterChecker

This commit is contained in:
anujgaud 2023-10-23 23:45:43 +05:30 committed by GitHub
parent 9756cb1d10
commit e99ce4da19
1 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,38 @@
package com.baeldung.unicode;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
public class UnicodeLetterCheckerUnitTest {
@Test
public void givenString_whenUsingIsLetter_thenReturnTrue() {
UnicodeLetterChecker checker = new UnicodeLetterChecker();
boolean isUnicodeLetter = checker.characterClassCheck("HelloWorld");
assertTrue(isUnicodeLetter);
}
@Test
public void givenString_whenUsingRegex_thenReturnTrue() {
UnicodeLetterChecker checker = new UnicodeLetterChecker();
boolean isUnicodeLetter = checker.regexCheck("HelloWorld");
assertTrue(isUnicodeLetter);
}
@Test
public void givenString_whenUsingIsAlpha_thenReturnTrue() {
UnicodeLetterChecker checker = new UnicodeLetterChecker();
boolean isUnicodeLetter = checker.isAlphaCheck("HelloWorld");
assertTrue(isUnicodeLetter);
}
@Test
public void givenString_whenUsingStreams_thenReturnTrue() {
UnicodeLetterChecker checker = new UnicodeLetterChecker();
boolean isUnicodeLetter = checker.StreamsCheck("HelloWorld");
assertTrue(isUnicodeLetter);
}
}