public void testViewOtherProfiles() { User user1 = new User("user1", "city1", "*****@*****.**", null); User johnCena = new User("The Heavyweight Champion", "WWE RAW", "*****@*****.**", null); User user2 = new User("user2", "city2", "*****@*****.**", null); user1.addFriend(johnCena); user1.addFriend(user2); assertEquals(johnCena, user1.getFriend("The Heavyweight Champion")); assertTrue(user1.getFriend("The Heavyweight Champion").getLocation().equals("WWE RAW")); }
public void testRemoveFriend() { User user1 = new User("user1", "city1", "*****@*****.**", null); User johnCena = new User("johnCena", "WWE", "*****@*****.**", null); User user2 = new User("user2", "city2", "*****@*****.**", null); user1.addFriend(johnCena); user1.addFriend(user2); user1.removeFriend(johnCena); assertEquals(null, user1.getFriend("johnCena")); }
public void testAddFriend() { User johnCena = new User("WWE", "Salt lake City", "*****@*****.**", null); User user1 = new User("User1", "City1", "*****@*****.**", null); johnCena.addFriend(user1); assertEquals(user1, johnCena.getFriend("User1")); }