Add tests for UnicodeLetterChecker
This commit is contained in:
parent
9756cb1d10
commit
e99ce4da19
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue