コード例 #1
0
  @SmallTest
  @MediumTest
  @LargeTest
  public void testSettingGraphObjectProxyStoresJSONObject() throws JSONException {
    GraphPlace graphPlace = GraphObject.Factory.create(GraphPlace.class);
    GraphLocation graphLocation = GraphObject.Factory.create(GraphLocation.class);

    graphPlace.setLocation(graphLocation);

    assertEquals(
        graphLocation.getInnerJSONObject(), graphPlace.getInnerJSONObject().get("location"));
  }
コード例 #2
0
  @SmallTest
  @MediumTest
  @LargeTest
  public void testCanSetComplexTypes() {
    GraphLocation graphLocation = GraphObject.Factory.create(GraphLocation.class);
    graphLocation.setCity("Seattle");

    GraphPlace graphPlace = GraphObject.Factory.create(GraphPlace.class);
    graphPlace.setLocation(graphLocation);

    assertEquals(graphLocation, graphPlace.getLocation());
    assertEquals("Seattle", graphPlace.getLocation().getCity());
  }