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

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.when;
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.delivery.facade.impl.ShopDeliveryFacadeImpl;
import com.ruoyi.web.modules.delivery.mapper.BizShopDeliverySettingMapper;

@ExtendWith(MockitoExtension.class)
class ShopDeliveryFacadeImplTest
{
    @Mock
    private BizShopDeliverySettingMapper deliverySettingMapper;

    @InjectMocks
    private ShopDeliveryFacadeImpl shopDeliveryFacade;

    @Test
    void getShipCity_returnsCityName()
    {
        when(deliverySettingMapper.selectCityNameByShopId(101L)).thenReturn("拉萨市");

        assertEquals("拉萨市", shopDeliveryFacade.getShipCity(101L));
    }

    @Test
    void getShipCity_nullWhenShopMissing()
    {
        assertNull(shopDeliveryFacade.getShipCity(null));
        assertNull(shopDeliveryFacade.getShipCity(0L));
    }
}
