-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTesteMeuArray.java
49 lines (33 loc) · 1.05 KB
/
TesteMeuArray.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
39
40
41
42
43
44
45
46
47
48
49
import static org.junit.jupiter.api.Assertions.*;
import java.util.ArrayList;
import java.util.List;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
class TesteMeuArray {
private List<Aluno> alunosList;
@BeforeEach
public void setup() {
alunosList = new ArrayList<Aluno>();
}
@Test
public void add() {
assertEquals(0, alunosList.size());
alunosList.add(new Aluno("Ana"));
alunosList.add(new Aluno("Maria"));
alunosList.add(new Aluno("Wesley"));
assertEquals(3, alunosList.size());
}
@Test
public void size() {
assertEquals(0, alunosList.size());
alunosList.add(new Aluno("Raquel"));
assertTrue(alunosList.size() > 0);
}
@Test
public void isEmpty() {
assertEquals(true, alunosList.isEmpty());
alunosList.add(new Aluno("Mariana"));
alunosList.add(new Aluno("Daniel"));
assertEquals(false, alunosList.isEmpty());
}
}