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

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

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

/**
 * GTFY-CG-UT-001、015
 */
@DisplayName("CommonProsperityAchievementRules")
class CommonProsperityAchievementRulesTest
{

    @Test
    @DisplayName("GTFY-CG-UT-001 统计范围格式")
    void ut001_statPeriodFormat()
    {
        assertTrue(CommonProsperityAchievementRules.isStatPeriodFormatValid("2026-05"));
        assertFalse(CommonProsperityAchievementRules.isStatPeriodFormatValid("2026-13"));
        assertFalse(CommonProsperityAchievementRules.isStatPeriodFormatValid("202605"));
        assertFalse(CommonProsperityAchievementRules.isStatPeriodFormatValid("2026/05"));
        assertFalse(CommonProsperityAchievementRules.isStatPeriodFormatValid(""));
        assertFalse(CommonProsperityAchievementRules.isStatPeriodFormatValid(null));
    }

    @Test
    @DisplayName("GTFY-CG-UT-015 无状态限制可编辑")
    void ut015_canEdit()
    {
        assertTrue(CommonProsperityAchievementRules.canEdit());
    }
}
