-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUsersTest.java
More file actions
44 lines (34 loc) · 1.17 KB
/
Copy pathUsersTest.java
File metadata and controls
44 lines (34 loc) · 1.17 KB
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
import static org.junit.jupiter.api.Assertions.*;
import java.util.ArrayList;
import java.util.UUID;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
class UsersTest {
private Users users = Users.getInstance();
private ArrayList<RegisteredUser> userList = new ArrayList<>();
private UUID userID = new UUID(0,1);
private RegistrationInfo userInfo = new RegistrationInfo("Ryan", "Davis", "rDavis", "password", 20, true);
private BookingList savedBookings = new BookingList();
private ArrayList<PartyMember> partyMembers = new ArrayList<>();
@BeforeEach
public void setup() {
userList.clear();
userList.add(new RegisteredUser(userID, userInfo, savedBookings, partyMembers));
}
@AfterEach
public void tearDown() {
userList.clear();
}
@Test
void testHaveUserValidFirstItem() {
assertEquals("Ryan", userList.get(0).getUserInfo().getFirstName());
}
@Test
void testHaveUserEmpty() {
assertEquals(false, Users.getInstance().getRegisteredUsers().get(0));
assertEquals(true, Users.getInstance().getRegisteredUsers().get(1));
}
}