Ejemplo n.º 1
0
  @Test
  public void testDelete() throws DatabaseException {

    Project census = new Project("census", 2, 3, 4, 5);
    Project births = new Project("births", 6, 7, 8, 9);

    dbProjects.add(census);
    dbProjects.add(births);

    List<Project> all = dbProjects.getAll();
    assertEquals(2, all.size());

    dbProjects.delete(census);
    dbProjects.delete(births);

    all = dbProjects.getAll();
    assertEquals(0, all.size());
  }
Ejemplo n.º 2
0
  @Test(expected = DatabaseException.class)
  public void testInvalidDelete() throws DatabaseException {

    Project invalidProject = new Project(null, -1, -1, -1, -1);
    dbProjects.delete(invalidProject);
  }