package com.ruoyi.web.modules.template.facade;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.when;
import java.util.Collections;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import com.ruoyi.web.modules.template.facade.impl.AttrTemplateFacadeImpl;
import com.ruoyi.web.modules.template.service.IAttrTemplateService;
import com.ruoyi.web.modules.template.vo.AttrTemplateOptionVO;

@ExtendWith(MockitoExtension.class)
class AttrTemplateFacadeImplTest
{
    @Mock
    private IAttrTemplateService attrTemplateService;

    @InjectMocks
    private AttrTemplateFacadeImpl attrTemplateFacade;

    @Test
    void listOptionsByShopId_delegates()
    {
        AttrTemplateOptionVO opt = new AttrTemplateOptionVO();
        opt.setTemplateId(1L);
        opt.setTemplateName("宠物");
        when(attrTemplateService.selectOptionsByShopId(101L)).thenReturn(Collections.singletonList(opt));

        assertEquals(1, attrTemplateFacade.listOptionsByShopId(101L).size());
    }
}
