package com.ruoyi.info.collection.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.info.collection.domain.vo.EnumOptionVO;
import org.junit.jupiter.api.Test;

import java.util.List;

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

class CcdiEnumControllerTest {

    private final CcdiEnumController controller = new CcdiEnumController();

    @Test
    void getEnterpriseRiskLevelOptions_shouldReturnConfiguredOptions() {
        AjaxResult result = controller.getEnterpriseRiskLevelOptions();
        List<?> data = (List<?>) result.get("data");

        assertEquals(3, data.size());
        EnumOptionVO first = (EnumOptionVO) data.get(0);
        assertEquals("1", first.getValue());
        assertEquals("高风险", first.getLabel());
    }

    @Test
    void getEnterpriseSourceOptions_shouldReturnConfiguredOptions() {
        AjaxResult result = controller.getEnterpriseSourceOptions();
        List<?> data = (List<?>) result.get("data");

        assertFalse(data.isEmpty());
        EnumOptionVO first = (EnumOptionVO) data.get(0);
        assertEquals("GENERAL", first.getValue());
        assertEquals("一般企业", first.getLabel());
    }
}
