package me.chyxion.tigon.service.test;

import org.junit.Test;
import org.junit.runner.RunWith;
import me.chyxion.tigon.model.TestModel;
import me.chyxion.tigon.service.TestModelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * @author Shaun Chyxion <br>
 * chyxion@163.com <br>
 * Apr 19, 2017 10:59:07
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath*:spring/spring-*.xml")
public class TestModelServiceTest {
    @Autowired
    private TestModelService testModelService;

    @Test
    public void testInsert() {
        TestModel testModel = new TestModel();
        testModel.setName("test");
        testModel.setNote("test note");
        testModel.setCreatedBy("donghuang");
        testModel.setEnabled(true);
        testModelService.create(testModel);
    }

    @Test
    public void testUpdate() {
        System.err.println(testModelService.list(null));
    }
}
