package com.ruoyi.web.modules.technology.support;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import com.ruoyi.web.modules.farming.support.TechResourceRules;

@DisplayName("OnlineTrainingCourseRules")
class OnlineTrainingCourseRulesTest
{

    @Test
    @DisplayName("视频文件名解析")
    void videoFileName()
    {
        assertEquals("course.mp4",
                OnlineTrainingCourseRules.resolveVideoFileName("/profile/upload/2025/a/course.mp4"));
        assertEquals("course.mp4",
                OnlineTrainingCourseRules.resolveVideoFileName("course.mp4"));
        assertEquals(OnlineTrainingCourseRules.DEFAULT_VIDEO_FILE_LABEL,
                OnlineTrainingCourseRules.resolveVideoFileName(null));
        assertEquals(OnlineTrainingCourseRules.DEFAULT_VIDEO_FILE_LABEL,
                OnlineTrainingCourseRules.resolveVideoFileName(""));
    }

    @Test
    @DisplayName("纳入常量与源库一致")
    void inclusionConstants()
    {
        assertEquals(TechResourceRules.RESOURCE_TYPE_VIDEO, OnlineTrainingCourseRules.resourceTypeVideo());
        assertEquals(TechResourceRules.PUBLISH_STATUS_PUBLISHED,
                OnlineTrainingCourseRules.publishStatusPublished());
        assertEquals(TechResourceRules.DEL_FLAG_NORMAL, OnlineTrainingCourseRules.delFlagNormal());
        assertEquals("005001", TechResourceRules.COURSE_TOPIC_BASIC);
        assertEquals("005004", TechResourceRules.COURSE_TOPIC_POLICY);
    }
}
