package com.hc.web;


import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
class CourseTypeServiceTests {

/*
暂时保留没有启用

    @Autowired
    CourseTypeService courseTypeService;

    private static final String REDIS_KEY_PREFIX = "user:video:position:";

    @Autowired
    RedisUtil redisUtil;


    @Test
    void test_course_type(){

        //插入一个根节点
        CourseType type = new CourseType();
        type.setParentId(0);
        type.setLevelId(0);
        type.setTypeName("测试根节点");
        courseTypeService.insert(type);

        //插入子节点1
        CourseType child1= new CourseType();
        child1.setTypeName("child1");
        child1.setLevelId(0);
        child1.setParentId(type.getCourseTypeId());
        courseTypeService.insert(child1);

//插入子节点2
        CourseType child2= new CourseType();
        child2.setTypeName("child2");
        child2.setParentId(type.getCourseTypeId());
        child2.setLevelId(0);
        courseTypeService.insert(child2);
        List<CourseType> list = courseTypeService.getCourseTypeChildList(type.getCourseTypeId());

        //应该有3个数据
        assert (null != list);
        assert (list.size() == 3);

        //插入孙子节点
        CourseType child11= new CourseType();
        child11.setTypeName("child11");
        child11.setLevelId(0);
        child11.setParentId(child1.getCourseTypeId());
        courseTypeService.insert(child11);

        list = courseTypeService.getCourseTypeChildList(child1.getCourseTypeId());
        assert (list.size() == 2);

    }
*/


}
