package com.YuyeTech.TPlat.service.impl;

import com.YuyeTech.TPlat.dataobject.ProductCategory;
import org.junit.Assert;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest
class CategoryServiceImplTest {

    //cate 类实现的测试
    @Autowired
    private CategoryServiceImpl categoryService;

    @Test
    void findOne() {
//        ProductCategory productCategory = categoryService.findOne(1);
//        Assert.assertEquals(new Integer(1), productCategory.getCategoryId());
    }

    @Test
    void findAll() {
        List<ProductCategory> productCategoryList = categoryService.findAll();
        Assert.assertNotEquals(0,productCategoryList.size());
    }

    @Test
    void findByCategoryTypeIn() {
//        List<ProductCategory> productCategoryList = categoryService.findByCategoryTypeIn(Arrays.asList(2,3,4));
//        Assert.assertNotEquals(0,productCategoryList.size());
    }

    @Test
    void save() {
//        ProductCategory productCategory = new ProductCategory("宅男必备",5);
//        ProductCategory result = categoryService.save(productCategory);
//        Assert.assertNotEquals(null,result);

    }
}