mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-12-19 07:00:35 +08:00
16 lines
658 B
Java
16 lines
658 B
Java
package com.thealgorithms.strings;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
|
|
import org.junit.jupiter.params.ParameterizedTest;
|
|
import org.junit.jupiter.params.provider.CsvSource;
|
|
|
|
public class AlphabeticalTest {
|
|
|
|
@ParameterizedTest(name = "\"{0}\" → Expected: {1}")
|
|
@CsvSource({"'abcdefghijklmno', true", "'abcdxxxyzzzz', true", "'123a', false", "'abcABC', false", "'abcdefghikjlmno', false", "'aBC', true", "'abc', true", "'xyzabc', false", "'abcxyz', true", "'', false", "'1', false"})
|
|
void testIsAlphabetical(String input, boolean expected) {
|
|
assertEquals(expected, Alphabetical.isAlphabetical(input));
|
|
}
|
|
}
|