package com.ruoyi.web.modules.diagnosis.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;
import com.ruoyi.web.modules.diagnosis.domain.BizMedicalResource;

@DisplayName("OnlineConsultVetSupport")
class OnlineConsultVetSupportTest
{
    @Test
    @DisplayName("在线接诊模式识别")
    void onlineMode()
    {
        assertTrue(OnlineConsultVetSupport.hasOnlineConsultMode("1,3"));
        assertFalse(OnlineConsultVetSupport.hasOnlineConsultMode("1,2"));
    }

    @Test
    @DisplayName("可问诊兽医")
    void consultable()
    {
        BizMedicalResource vet = new BizMedicalResource();
        vet.setResourceType(MedicalResourceRules.RESOURCE_TYPE_VET);
        vet.setDelFlag(MedicalResourceRules.DEL_FLAG_NORMAL);
        vet.setPublishStatus(MedicalResourceRules.PUBLISH_STATUS_PUBLISHED);
        vet.setConsultModes("3");
        vet.setSysUserId(10L);
        vet.setAccountAssigned(MedicalResourceRules.ACCOUNT_ASSIGNED_YES);
        assertTrue(OnlineConsultVetSupport.isConsultablePublishedVet(vet));
    }
}
