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

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

import java.util.Date;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import com.ruoyi.web.modules.farming.TechResourceTestSamples;
import com.ruoyi.web.modules.farming.domain.BizTechResource;

@DisplayName("TechResourcePublishStatusResolver")
class TechResourcePublishStatusResolverTest
{

    @Test
    @DisplayName("三态解析")
    void displayStatus()
    {
        assertEquals(TechResourceRules.QUERY_PUBLISH_OFFLINE,
                TechResourcePublishStatusResolver.resolveDisplayCode(0, new Date()));
        BizTechResource row = TechResourceTestSamples.sampleExpertDraft();
        TechResourcePublishStatusResolver.applyDisplayStatus(row);
        assertEquals("未发布", row.getDisplayPublishStatusName());
        assertEquals(Boolean.TRUE, row.getCanAssignAccount());
    }
}
