Add test for Pangram.java (#2986)
This commit is contained in:
parent
1d5d672fbd
commit
8b71a15cbb
24
src/test/java/com/thealgorithms/strings/PangramTest.java
Normal file
24
src/test/java/com/thealgorithms/strings/PangramTest.java
Normal file
@ -0,0 +1,24 @@
|
||||
package com.thealgorithms.strings;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
|
||||
public class PangramTest {
|
||||
@Test
|
||||
public void isPangram() {
|
||||
String fullAlphabet = "abcdefghijklmnopqrstuvwxyz";
|
||||
String notFullAlphabet = "abcdefghiklmnopqrstuvwxyz";
|
||||
String fullMixedCaseAlphabet = "a BCDE fghIjkLMnop qrSTuv WXYz";
|
||||
String sentence1 = "The quick brown fox jumps over the lazy dog";
|
||||
String sentence2 = "The quick brown fox jumps over the lazy gentleman"; // missing letter d
|
||||
|
||||
assertTrue(Pangram.isPangram(fullAlphabet));
|
||||
assertFalse(Pangram.isPangram(notFullAlphabet));
|
||||
assertTrue(Pangram.isPangram(fullMixedCaseAlphabet));
|
||||
assertTrue(Pangram.isPangram(sentence1));
|
||||
assertFalse(Pangram.isPangram(sentence2));
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user