@Test public void testGetSecondOrderFriends() { FacePamphletDatabase theBase = new FacePamphletDatabase(); FacePamphletProfile test = new FacePamphletProfile("Test Profile"); FacePamphletProfile jimmy = new FacePamphletProfile("Jimmy"); FacePamphletProfile timmy = new FacePamphletProfile("Timmy"); FacePamphletProfile shimmy = new FacePamphletProfile("Shimmy"); FacePamphletProfile joseph = new FacePamphletProfile("Joseph"); FacePamphletProfile mom = new FacePamphletProfile("Your Mother"); theBase.addProfile(test); theBase.addProfile(jimmy); theBase.addProfile(timmy); theBase.addProfile(shimmy); theBase.addProfile(joseph); theBase.addProfile(mom); jimmy.addFriend(timmy); jimmy.addFriend(mom); timmy.addFriend(shimmy); timmy.addFriend(joseph); timmy.addFriend(timmy); test.addFriend(jimmy); test.addFriend(timmy); ArrayList<String> testList = new ArrayList<String>(); testList.add("Timmy"); testList.add("Shimmy"); testList.add("Joseph"); testList.add("Your Mother"); assertEquals(testList, test.getSecondOrderFriends()); }
@Test public void testGetFriendsOf() { FacePamphletProfile test = new FacePamphletProfile("Test Profile"); FacePamphletProfile jimmy = new FacePamphletProfile("Jimmy"); FacePamphletProfile timmy = new FacePamphletProfile("Timmy"); FacePamphletProfile mom = new FacePamphletProfile("Your Mother"); test.addFriend(jimmy); jimmy.addFriend(timmy); jimmy.addFriend(mom); ArrayList<String> testList = new ArrayList<String>(); testList.add("Timmy"); testList.add("Your Mother"); assertEquals(testList, test.getFriendsOf(jimmy)); }
@Test public void testRemoveFriend() { FacePamphletProfile test = new FacePamphletProfile("Test Profile"); FacePamphletProfile jimmy = new FacePamphletProfile("Jimmy"); test.addFriend(jimmy); test.removeFriend(jimmy.getName()); assertEquals(0, test.getFriends().size()); }
@Test public void testAddFriend() { FacePamphletProfile test = new FacePamphletProfile("Test Profile"); FacePamphletProfile jimmy = new FacePamphletProfile("Jimmy"); test.addFriend(jimmy); // assertEquals(1, test.getFriends().size()); String friend = test.getFriends().get(0); assertEquals("Jimmy", friend); }
@Test public void testAddBirthdayNotification() { FacePamphletProfile test = new FacePamphletProfile("Test Profile"); FacePamphletProfile jimmy = new FacePamphletProfile("Jimmy"); Calendar currentDate = Calendar.getInstance(); SimpleDateFormat formatter = new SimpleDateFormat("MM/dd"); String dateNow = formatter.format(currentDate.getTime()); jimmy.setBirthday(12, 4); test.addFriend(jimmy); test.addBirthdayNotifications(); assertTrue(test.getNotifications().contains("Jimmy's birthday is coming up on 12/4!!")); }