From 9b0681f0cfbbdd4242a8bcd794307b0d1d23244e Mon Sep 17 00:00:00 2001 From: Yadukrishnan Date: Sun, 25 Feb 2024 09:49:02 +0100 Subject: [PATCH] added more test cases --- .../baeldung/initials/GetInitialsFromNameUnitTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core-java-modules/core-java-string-operations-8/src/test/java/com/baeldung/initials/GetInitialsFromNameUnitTest.java b/core-java-modules/core-java-string-operations-8/src/test/java/com/baeldung/initials/GetInitialsFromNameUnitTest.java index a67305e33d..1998a1d1ac 100644 --- a/core-java-modules/core-java-string-operations-8/src/test/java/com/baeldung/initials/GetInitialsFromNameUnitTest.java +++ b/core-java-modules/core-java-string-operations-8/src/test/java/com/baeldung/initials/GetInitialsFromNameUnitTest.java @@ -15,28 +15,28 @@ import static org.junit.jupiter.api.Assertions.assertEquals; public class GetInitialsFromNameUnitTest { @ParameterizedTest - @CsvSource({"John F Kennedy,JFK", ",''", "'',''", "Not Correct 88text,NC", "michael jackson,MJ", "1test 2test, ''"}) + @CsvSource({"John F Kennedy,JFK", ",''", "'',''", "Not Correct 88text,NC", "michael jackson,MJ", "123,''", "123 234A, ''", "1test 2test, ''"}) public void getInitialFromName_usingLoop(String input, String expected) { String initial = getInitialUsingLoop(input); assertEquals(expected, initial); } @ParameterizedTest - @CsvSource({"John F Kennedy,JFK", ",''", "'',''", "Not Correct 88text,NC", "michael jackson,MJ", "1test 2test, ''"}) + @CsvSource({"John F Kennedy,JFK", ",''", "'',''", "Not Correct 88text,NC", "michael jackson,MJ", "123,''", "123 234A, ''", "1test 2test, ''"}) public void getInitialFromName_usingStringTokenizer(String input, String expected) { String initial = getInitialUsingStringTokenizer(input); assertEquals(expected, initial); } @ParameterizedTest - @CsvSource({"John F Kennedy,JFK", ",''", "'',''", "Not Correct 88text,NC", "michael jackson,MJ", "1test 2test, ''"}) + @CsvSource({"John F Kennedy,JFK", ",''", "'',''", "Not Correct 88text,NC", "michael jackson,MJ", "123,''", "123 234A, ''", "1test 2test, ''"}) public void getInitialFromName_usingRegex(String input, String expected) { String initial = getInitialUsingRegex(input); assertEquals(expected, initial); } @ParameterizedTest - @CsvSource({"John F Kennedy,JFK", ",''", "'',''", "Not Correct 88text,NC", "michael jackson,MJ", "1test 2test, ''"}) + @CsvSource({"John F Kennedy,JFK", ",''", "'',''", "Not Correct 88text,NC", "michael jackson,MJ", "123,''", "123 234A, ''", "1test 2test, ''"}) public void getInitialFromName_usingStreamsAPI(String input, String expected) { String initial = getInitialUsingStreamsAPI(input); assertEquals(expected, initial);