package com.izouma.dingdong.contorller;

import com.izouma.dingdong.domain.merchant.MerchantClassification;
import com.izouma.dingdong.web.merchant.MerchantClassificationController;
import org.junit.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;

@SpringBootTest
@RunWith(SpringRunner.class)
public class ClassificationControllerTest {

    @Autowired
    private MerchantClassificationController controller;

    @Test
    public void testDel(){
        controller.del(1L);
    }

    @Test
    public void testDelGoods(){
        controller.delGoods(1L,109L);
    }

    @Test
    public void testSave(){
        MerchantClassification classification = new MerchantClassification();

        classification.setId(205L);
        classification.setName("点单必读");
        classification.setSort(1);
        classification.setMerchantId(189L);
        classification.setGoodsIds("310,311");
        classification.setIsOpen(false);
        classification.setIsShow(true);
        System.out.println(controller.save(classification));
    }

    @Test
    public void show(){
        System.out.println(controller.allGoods(475L));
    }
}
