コード例 #1
0
  @Test
  public void testAddNewAuto() {
    AutoTO auto = new AutoTO("qq444qq", "Reanult Twingo", "D", "A", 0, LocalDate.now(), "1");
    boolean[] expected = {true, false};

    for (int i = 0; i < expected.length; i++) {
      assertEquals("Failed at " + i, gestAuto.addNewAuto(auto), expected[i]);
    }
    gestAuto.delete(auto.getTarga());
  }
コード例 #2
0
  @Test
  public void testUpdate() {
    AutoTO backToNormal = gestAuto.getAuto("kj088fv");

    AutoTO autoValida = gestAuto.getAuto("kj088fv");
    autoValida.setKm(870);
    AutoTO autoNonValida =
        new AutoTO("qq444qq", "Reanult Twingo", "D", "A", 0, LocalDate.now(), "1");

    AutoTO[] auto = {autoValida, autoNonValida};
    boolean[] expected = {true, false};

    for (int i = 0; i < expected.length; i++) {
      assertEquals("Failed at " + i, gestAuto.update(auto[i]), expected[i]);
    }
    gestAuto.update(backToNormal);
  }