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-BTSX-UT-017
 */
@DisplayName("SubsidyMatterRules")
class SubsidyMatterRulesTest
{
    @Test
    @DisplayName("ZCZX-BTSX-UT-017 删除守卫")
    void ut017_canDelete()
    {
        assertTrue(SubsidyMatterRules.canDelete(0));
        assertFalse(SubsidyMatterRules.canDelete(1));
    }

    @ParameterizedTest
    @CsvSource({ "0, true", "1, false" })
    @DisplayName("编辑守卫")
    void canEdit(int status, boolean expected)
    {
        assertEquals(expected, SubsidyMatterRules.canEdit(status));
    }

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

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