/*
 * Arrebol Consultancy copyright.
 * 
 * This code belongs to Arrebol Consultancy
 * its use, redistribution or modification are prohibited 
 * without written authorization from Arrebol Consultancy.
 */
package com.arrebol.taxiservicios.controller.stocktaking;

import com.arrebol.taxiservicios.model.stocktaking.ServiceOrder;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import static org.junit.Assert.assertFalse;
import org.junit.Before;
import org.junit.Test;

/**
 *
 * @author Carlos Janitzio Zavala Lopez <janitzio.zavala@arrebol.com.mx>
 */
public class ServiceOrderServiceImplTest {

    private static final String TAXI_ID = "832d1f90-61de-4ab7-a6a9-0e2916fffead";
    private static final String DRIVER_ID = "1a24616e-9576-4879-b6f9-e52c6fdf400f";

    private ServiceOrderService service;

    @Before
    public void setUp() throws Exception {
        service = new ServiceOrderServiceImpl();
    }

    @Test
    public void findRangeOfDateFromOrderByTaxiBetweenStartAndEndDate() {
        try {
            Calendar startDate = Calendar.getInstance();
            startDate.add(Calendar.MONTH, -1);
            Calendar endDate = Calendar.getInstance();
            endDate.add(Calendar.DAY_OF_MONTH, 23);

            List<ServiceOrder> results = service.findRangeOfDateFromOrderByDriverIdBetweenStartAndEndDate(DRIVER_ID, startDate.getTime(), endDate.getTime());

            results.forEach(System.out::println);
            assertFalse(results.isEmpty());
        } catch (Exception e) {
            assertFalse(true);
        }
    }
}
