package com.ylx.giftCard.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ylx.giftCard.domain.dto.UserShoppingFundsDetailQueryDTO;
import com.ylx.giftCard.domain.vo.UserShoppingFundsDetailItemVO;
import org.junit.jupiter.api.Test;

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

public class GiftCardOrderServiceImplTest {

    @Test
    public void pcShoppingFundsDetailRejectsBlankUserId() {
        GiftCardOrderServiceImpl service = new GiftCardOrderServiceImpl();
        UserShoppingFundsDetailQueryDTO query = new UserShoppingFundsDetailQueryDTO();
        query.setUserId(" ");
        query.setDetailType(0);

        IllegalArgumentException exception = assertThrows(IllegalArgumentException.class,
                () -> service.getPcUserShoppingFundsDetail(new Page<UserShoppingFundsDetailItemVO>(), query));

        assertEquals("userId不能为空", exception.getMessage());
    }
}
