forked from kishanrajput23/Java-Projects-Collections
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGeneratorTest.java
38 lines (29 loc) · 991 Bytes
/
GeneratorTest.java
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
36
37
38
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.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);
// private final Password generatedPassword = generator.GeneratePassword(4);
@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);
}
}