forked from TheAlgorithms/Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPangramTest.java
More file actions
24 lines (18 loc) · 844 Bytes
/
PangramTest.java
File metadata and controls
24 lines (18 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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));
}
}