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

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

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

@DisplayName("ConsultAiGatewayImpl")
class ConsultAiGatewayImplTest
{
    private final ConsultAiGatewayImpl gateway = new ConsultAiGatewayImpl();

    @Test
    @DisplayName("视频固定文案")
    void videoReply()
    {
        assertEquals(AiConsultConstants.REPLY_VIDEO,
                gateway.generateReply(ConsultSessionRules.MSG_TYPE_VIDEO, null, "http://x/a.mp4"));
    }

    @Test
    @DisplayName("语音固定文案")
    void voiceReply()
    {
        assertEquals(AiConsultConstants.REPLY_VOICE,
                gateway.generateReply(ConsultSessionRules.MSG_TYPE_VOICE, null, "http://x/a.mp3"));
    }

    @Test
    @DisplayName("图片无文字软回复")
    void imageFallback()
    {
        assertEquals(AiConsultConstants.REPLY_IMAGE_FALLBACK,
                gateway.generateReply(ConsultSessionRules.MSG_TYPE_IMAGE, null, "http://x/a.jpg"));
    }

    @Test
    @DisplayName("文本回复含用户描述")
    void textReply()
    {
        String reply = gateway.generateReply(ConsultSessionRules.MSG_TYPE_TEXT, "精神沉郁", null);
        assertTrue(reply.contains("精神沉郁"));
    }
}
