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

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

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

@DisplayName("身份证校验工具")
class PastureValidationTest
{
    private static final String VALID_ID_CARD = "11010519491231002X";

    @Test
    @DisplayName("合法身份证校验位通过")
    void validIdCard()
    {
        assertTrue(PastureValidation.isIdCardChecksumValid(VALID_ID_CARD));
    }

    @Test
    @DisplayName("错误校验位失败")
    void invalidChecksum()
    {
        assertFalse(PastureValidation.isIdCardChecksumValid("11010519491231002Y"));
    }
}
