Пример #1
0
  /** Test of valueOf method, of class PlaceType. */
  @Test
  public void testValueOf() {
    String name = "BUSINESS";
    PlaceType expResult = PlaceType.BUSINESS;
    PlaceType result = PlaceType.valueOf(name);
    assertEquals(expResult, result);

    name = "RECREATION";
    expResult = PlaceType.RECREATION;
    result = PlaceType.valueOf(name);
    assertEquals(expResult, result);

    name = "RESTAURANT";
    expResult = PlaceType.RESTAURANT;
    result = PlaceType.valueOf(name);
    assertEquals(expResult, result);
  }
Пример #2
0
  /** Test of values method, of class PlaceType. */
  @Test
  public void testValues() {
    List<PlaceType> list = new ArrayList<PlaceType>();
    list.add(PlaceType.BUSINESS);
    list.add(PlaceType.RESTAURANT);
    list.add(PlaceType.RECREATION);

    PlaceType[] result = PlaceType.values();
    assertEquals(result.length, list.size());
    for (PlaceType pt : result) {
      assertTrue(list.contains(pt));
    }
  }