/*
 * 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.catalog;

import com.arrebol.taxiservicios.model.catalog.Product;
import java.util.List;
import static org.junit.Assert.assertNotNull;
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 ProductControllerTest {

    private ProductController controller;

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

    @Test
    public void searchProductsLikeField() {
        try {
            List<Product> results = controller.searchProductsLikeField(false, "%123%");

            results.forEach(System.out::println);

            assertFalse(results.isEmpty());
        } catch (Exception e) {
            assertNotNull(null);
        }
    }
    
     @Test
    public void fillProductDatatableLikeBrand() {
        try {
            List<Product> results = controller.searchProductByBrand("3106de5a-7309-44cd-ae64-7613c866a916");

            results.forEach(System.out::println);

            assertFalse(results.isEmpty());
        } catch (Exception e) {
            assertNotNull(null);
        }
    }
}
