コード例 #1
0
 private void assertSingleCheckin(Checkin checkin) {
   assertEquals("10150431253050580", checkin.getId());
   assertEquals("738140579", checkin.getFrom().getId());
   assertEquals("Craig Walls", checkin.getFrom().getName());
   Page place1 = checkin.getPlace();
   assertEquals("117372064948189", place1.getId());
   assertEquals("Freebirds World Burrito", place1.getName());
   assertEquals("238 W Campbell Rd", place1.getLocation().getStreet());
   assertEquals("Richardson", place1.getLocation().getCity());
   assertEquals("TX", place1.getLocation().getState());
   assertEquals("United States", place1.getLocation().getCountry());
   assertEquals("75080-3512", place1.getLocation().getZip());
   assertEquals(32.975537, place1.getLocation().getLatitude(), 0.0001);
   assertEquals(-96.722944, place1.getLocation().getLongitude(), 0.0001);
   assertEquals("6628568379", checkin.getApplication().getId());
   assertEquals("Facebook for iPhone", checkin.getApplication().getName());
   assertEquals(toDate("2011-03-13T01:00:49+0000"), checkin.getCreatedTime());
 }
コード例 #2
0
 private void assertCheckins(List<Checkin> checkins) {
   assertEquals(2, checkins.size());
   assertSingleCheckin(checkins.get(0));
   Checkin checkin2 = checkins.get(1);
   assertEquals("10150140239512040", checkin2.getId());
   assertEquals("533477039", checkin2.getFrom().getId());
   assertEquals("Raymie Walls", checkin2.getFrom().getName());
   assertEquals(1, checkin2.getTags().size());
   assertEquals("738140579", checkin2.getTags().get(0).getId());
   assertEquals("Craig Walls", checkin2.getTags().get(0).getName());
   assertEquals("With my favorite people! ;-)", checkin2.getMessage());
   Page place2 = checkin2.getPlace();
   assertEquals("150366431753543", place2.getId());
   assertEquals("Somewhere", place2.getName());
   assertEquals(35.0231428, place2.getLocation().getLatitude(), 0.0001);
   assertEquals(-98.740305416667, place2.getLocation().getLongitude(), 0.0001);
   assertEquals("6628568379", checkin2.getApplication().getId());
   assertEquals("Facebook for iPhone", checkin2.getApplication().getName());
   assertEquals(toDate("2011-02-11T20:59:41+0000"), checkin2.getCreatedTime());
   assertEquals(2, checkin2.getLikes().size());
   assertEquals("1524405653", checkin2.getLikes().get(0).getId());
   assertEquals("Samuel Hugh Parsons", checkin2.getLikes().get(0).getName());
   assertEquals("1580082219", checkin2.getLikes().get(1).getId());
   assertEquals("Kris Len Nicholson", checkin2.getLikes().get(1).getName());
   assertEquals(1, checkin2.getComments().size());
   assertEquals("10150140239512040_15204657", checkin2.getComments().get(0).getId());
   assertEquals("100000094813002", checkin2.getComments().get(0).getFrom().getId());
   assertEquals("Otis Nelson", checkin2.getComments().get(0).getFrom().getName());
   assertEquals("You are not with me!!!!", checkin2.getComments().get(0).getMessage());
   assertEquals(
       toDate("2011-02-11T21:31:31+0000"), checkin2.getComments().get(0).getCreatedTime());
 }