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

import static org.junit.jupiter.api.Assertions.assertEquals;
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;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;

/**
 * ZCZX-BTXM-UT-018
 */
@DisplayName("SubsidyProjectRules")
class SubsidyProjectRulesTest
{
    @Test
    @DisplayName("ZCZX-BTXM-UT-018 编辑守卫")
    void ut018_canEdit()
    {
        assertTrue(SubsidyProjectRules.canEdit(0));
        assertFalse(SubsidyProjectRules.canEdit(1));
    }

    @ParameterizedTest
    @CsvSource({ "0, true", "1, false" })
    @DisplayName("发布守卫")
    void canPublish(int status, boolean expected)
    {
        assertEquals(expected, SubsidyProjectRules.canPublish(status));
    }

    @ParameterizedTest
    @CsvSource({ "1, true", "0, false" })
    @DisplayName("下架守卫")
    void canOffline(int status, boolean expected)
    {
        assertEquals(expected, SubsidyProjectRules.canOffline(status));
    }
}
