Exemplo n.º 1
0
  @Test
  public void testPopulatedListSize() {
    List<String> carList = new ArrayList<String>();
    SearchDBHelper searchDBHelper = new SearchDBHelper();
    try {
      carList = searchDBHelper.populateList();
    } catch (CarDekhoSystemException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    int numberOfCars = carList.size();
    assertEquals(8, numberOfCars);
  }
Exemplo n.º 2
0
  @Test
  public void testPopulatedList() {
    List<String> carList = new ArrayList<String>();
    SearchDBHelper searchDBHelper = new SearchDBHelper();
    try {
      carList = searchDBHelper.populateList();
    } catch (CarDekhoSystemException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String firstCar = carList.get(0);
    boolean flag = false;
    if (firstCar.equalsIgnoreCase("maruti-dzire")) {
      flag = true;
    }

    assertTrue(flag);
  }
Exemplo n.º 3
0
  @Test
  public void testSearchCar() {
    List<Vehicle> carList = new ArrayList<Vehicle>();
    SearchDBHelper searchDBHelper = new SearchDBHelper();
    try {
      carList = searchDBHelper.searchCar("Maruti", "dzire");
    } catch (CarDekhoSystemException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    Vehicle vehicle = carList.get(0);
    String make = "Maruti";
    boolean flag = false;
    if (make.equalsIgnoreCase(vehicle.getMake())) {
      flag = true;
    }

    assertTrue(flag);
  }