package com.cf.imes.module.system.validation.invoice;

import com.cf.imes.framework.test.core.ut.BaseMockitoUnitTest;
import com.cf.imes.module.system.enums.pay.InvoiceTypeEnum;
import jakarta.validation.ConstraintValidatorContext;
import org.junit.jupiter.api.Test;
import org.mockito.Mock;

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

/**
 * @author Gqr
 * @since 2025/10/29 10:12
 */
class InvoiceTypeValidtorTest extends BaseMockitoUnitTest {
    @Mock
    private ConstraintValidatorContext constraintValidatorContext;

    @Test
    void testValid() {
        InvoiceTypeValidtor validator = new InvoiceTypeValidtor();
        assertTrue(validator.isValid(InvoiceTypeEnum.VAT_GENERAL.getValue(), constraintValidatorContext));
        assertTrue(validator.isValid(InvoiceTypeEnum.VAT_SPECIAL.getValue(), constraintValidatorContext));
        assertTrue(validator.isValid(null, constraintValidatorContext));
        assertFalse(validator.isValid(100, constraintValidatorContext));
    }
}