-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHelperClass.java
More file actions
44 lines (37 loc) · 2.06 KB
/
HelperClass.java
File metadata and controls
44 lines (37 loc) · 2.06 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
public class HelperClass
{
static void userAdderToNetwork()
{
//--------------------------Creates 5 users for testing some of the methods that have been created-------------------------------
Network.addUser("aris","aris13pat@gmail.com");
Network.addUser("elen","elen13pat@gmail.com");
Network.addUser("george","george13pat@gmail.com");
Network.addUser("maria","maria13pat@gmail.com");
Network.addUser("alex","alex13pat@gmail.com");
//-------Creation of reference objects to the arrayList of Network.registeredUsers that we can use and understand------------
User aris = User.getUserFromString("aris");
User elen = User.getUserFromString("elen");
User george = User.getUserFromString("george");
User maria = User.getUserFromString("maria");
User alex = User.getUserFromString("alex");
//---------------------------------------------Creation of Friend Requests---------------------------------------------------
aris.sendFriendRequest(alex);
aris.sendFriendRequest(elen);
aris.sendFriendRequest(george);
maria.sendFriendRequest(aris);
elen.sendFriendRequest(maria); //Check for exception handling
maria.sendFriendRequest(elen);
elen.sendFriendRequest(elen);
maria.sendFriendRequest(george);
System.out.println("\n");
//--------------------------------------------Friends creation--------------------------------------------------------------
Network.setAsFriends(aris, elen); // An acceptance after a sent friend request
Network.setAsFriends(aris, aris); // Trying to add as friend the same person.Exception
Network.setAsFriends(alex, george); //Trying to add friends without friend request.Exception
//----------------------------------Creation of posts that the user will post to his wall------------------------------------
aris.postToWall("Hello to all my future friends from Aris.");
elen.postToWall("Hello to all my future friends from Elen.");
george.postToWall("Hello to all my future friends from George.");
maria.postToWall("Hello to all my future friends from Maria.");
}
}