-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGeneratorTest.java
More file actions
35 lines (28 loc) · 988 Bytes
/
GeneratorTest.java
File metadata and controls
35 lines (28 loc) · 988 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
25
26
27
28
29
30
31
32
33
34
35
import static org.junit.jupiter.api.Assertions.*;
import org.junit.api.Test;
class GeneratorTest {
private final Password password = new Password("Secret");
private final Alphabet firstAlphabet = new Alphabet(true,false,false,false);
private final Alphabet secondAlphabet = new Alphabet(false,true,true,true);
private final Generator generator = new Generator(true,false,false,false);
@Test
void test1() {
assertEquals("Secret", password.toString());
}
@Test
void test2() {
assertEquals(firstAlphabet.getAlphabet(), Alphabet.UPPERCASE_LETTERS);
}
@Test
void test3() {
assertEquals(secondAlphabet.getAlphabet(), Alphabet.LOWERCASE_LETTERS + Alphabet.NUMBERS + Alphabet.SYMBOLS);
}
@Test
void test4() {
assertEquals(generator.alphabet.getAlphabet(), Alphabet.UPPERCASE_LETTERS);
}
@Test
void test5() {
assertEquals(generator.alphabet.getAlphabet().length(), 26);
}
}