mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-27 22:43:30 +08:00
refactor: CheckVowels
(#5393)
This commit is contained in:
@ -1,17 +1,15 @@
|
||||
package com.thealgorithms.strings;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.CsvSource;
|
||||
|
||||
public class CheckVowelsTest {
|
||||
class CheckVowelsTest {
|
||||
|
||||
@Test
|
||||
public void isVowel() {
|
||||
assertTrue(CheckVowels.hasVowels("foo"));
|
||||
assertTrue(CheckVowels.hasVowels("bar"));
|
||||
assertFalse(CheckVowels.hasVowels("why"));
|
||||
assertFalse(CheckVowels.hasVowels("myths"));
|
||||
@ParameterizedTest
|
||||
@CsvSource({"'foo', true", "'bar', true", "'why', false", "'myths', false", "'', false", "'AEIOU', true", "'bcdfghjklmnpqrstvwxyz', false", "'AeIoU', true"})
|
||||
void testHasVowels(String input, boolean expected) {
|
||||
assertEquals(CheckVowels.hasVowels(input), expected);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user