/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.arrebol.taxiservicios.controller.admin;

import com.arrebol.taxiservicios.model.admin.PersonHasService;
import com.arrebol.taxiservicios.model.admin.Service;
import com.arrebol.taxiservicios.model.core.Person;
import com.arrebol.taxiservicios.model.enums.PersonType;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author Picasso
 */
public class CustomerControllerUnitTest {

    private static final String EMPLOYEE_ID = "dc8d5b82-24b1-4dee-a98b-cbbbae50a4cf";
    private static final String CUSTOMER_ID = "e36ab88c-3dd4-4b81-a11e-32899d04d36c";

    private CustomerController controller;

    public CustomerControllerUnitTest() {
    }

    @Before
    public void setUp() {
        controller = new CustomerController();
    }

    //@Test
    public void getAllEmployees() {
        try {
            List<Person> employees = controller.getAllPersonByType(PersonType.CUSTOMER, EMPLOYEE_ID);

            assertNotNull(employees);
        } catch (Exception e) {
            assertNotNull(null);
        }
    }

    //@Test
    public void getAllServices() {
        try {
            List<Service> services = controller.getAllServices(true);

            assertNotNull(services);
        } catch (Exception e) {
            assertNotNull(null);
        }
    }

    //@Test
    public void saveOrUpdateService() {
        try {
            List<Service> servicesIn = controller.getAllServices(true);
            List<Service> servicesOut = new ArrayList<Service>();

            boolean success = controller.saveOrUpdatePersonHasServices(CUSTOMER_ID, servicesIn, servicesOut);

            assertTrue(success);
        } catch (Exception e) {
            assertNotNull(null);
        }
    }

    //@Test
    public void getAllServicesByCustomer() {
        try {
            List<PersonHasService> personHasServices = controller.getAllServicesByCustomer(CUSTOMER_ID);

            assertNotNull(personHasServices);
        } catch (Exception e) {
            assertNotNull(null);
        }
    }
}
