package cn.binarywang.tools.generator.bank;

import org.testng.annotations.*;

import static org.assertj.core.api.Assertions.assertThat;

/**
 * <pre>
 *
 * Created by Binary Wang on 2018/3/22.
 * </pre>
 *
 * @author <a href="https://github.com/binarywang">Binary Wang</a>
 */
public class BankCardNumberValidatorTest {

    @DataProvider
    public Object[][] data() {
        return new Object[][]{
            {"220812000026626544"},
            {"22480030862211715"},
            {"2284039453077174"},
            {"228480338189876372"},
            {"230203199407281216"},
            {"2304200060052505874"},
            {"2848042531203871"},
            {"2848395671637670"},
            {"3217211210001022999"},
            {"4295920020252229"},
            {"436742109067408"},
            {"441521198705193817"},
            {"610628199207140822"},
            {"6121260411007574030"},
            {"6126611104001552735"},
            {"6127004130000503693"},
            {"617000150017089191"},
            {"621003322005552162"},
            {"62101135200035338861"},
            {"621081103001115399914"},
            {"621111110000540353"},
            {"6211281082902084500"},
            {"6211500100000513202"},
            {"6211586100000512022"},
            {"62116613100007617106"},
            {"62117855000041067349"},
            {"6211931562029258"},
            {"6212202402018690921"},
            {"62122536020229386"},
            {"6212260200060118286"},
            {"62122613030006322041"},
            {"621226170202146127"},
            {"6212261703005715922"},
            {"62122617050113087625"},
            {"621226190805639730"},
            {"621226191300538209"},
            {"6212262003010018007"},
            {"621226201102782556"},
            {"6212262314007531443"},
            {"6212262502020825519"},
            {"6212262602001076686"},
            {"621226270300571592"},
            {"62122630140024065183"},
            {"6212263602066723007"},
            {"621226400000313859"},
            {"621226430100059399"},
            {"62122644020659520"},
            {"6212264402069510516"},
            {"6213361726663133666"},
            {"62136912100000479869"},
            {"6214003240016970298"},
            {"6214920200260744"},
            {"6214923700051218"},
            {"6215580405000660064"},
            {"6215580804001004167"},
            {"621558080900272864"},
            {"6215581503797096"},
            {"621558310005022166"},
            {"621568310000107077"},
            {"621568600000257443"},
            {"62156975000105300355"},
            {"6216616112000531669"},
            {"6217000011045925156"},
            {"62170000300007182833"},
            {"62170002020066090309"},
            {"62170006500002445588"},
            {"621700069000138104"},
            {"6217000944016450224"},
            {"621700150018466778"},
            {"621700203000646037"},
            {"621700219006453253"},
            {"621700243009386153"},
            {"6217002433023834253"},
            {"6217002850004855830"},
            {"6217002870018709777"},
            {"6217002870075668863"},
            {"621700292013558792"},
            {"62170029801064980053"},
            {"62170032200019774499"},
            {"62170033200638743228"},
            {"621700364006123065"},
            {"62170036500058141119"},
            {"6217003810859126600"},
            {"62170039500050012080"},
            {"621700396000230939"},
            {"6217004240009891"},
            {"6217007200059610"},
            {"62170096000230939"},
            {"62170907000015087180"},
            {"6217230912000742861"},
            {"621723110201493188"},
            {"62172326100008619"},
            {"621723271200100589"},
            {"621723401007064862"},
            {"6217566000030513202"},
            {"62176400019709352"},
            {"6217730800111976"},
            {"6217751768014206974"},
            {"621785360023745002"},
            {"621785700003456056"},
            {"6217857600037659668"},
            {"6217863100005832524"},
            {"6217863600001059634"},
            {"6217866000005105523"},
            {"62179065000087299770"},
            {"62179070000230171473"},
            {"6217958500010529317"},
            {"622003114460203036"},
            {"6220081001032758769"},
            {"6220580000016645996"},
            {"6221131400015644"},
            {"6221222000021697108"},
            {"62212262405006074701"},
            {"6221261410004280376"},
            {"6221560539933028"},
            {"6222004000107146212"},
            {"622202020012055669"},
            {"622202101059582285"},
            {"62220214000485852"},
            {"6222021602026082929"},
            {"622202163015279473"},
            {"62220227120052"},
            {"6222023142879408"},
            {"6222030905000202147"},
            {"6222031208974192"},
            {"6222032111000624285"},
            {"6222081200002662654"},
            {"622208120000666254"},
            {"6222081616001266171"},
            {"6222082806000878260"},
            {"622208406001797972"},
            {"62222032020000371017"},
            {"62223100001708091"},
            {"6222611210002887515"},
            {"622262015008134641"},
            {"622262021001711116"},
            {"6222620210223002615"},
            {"622262240001291709"},
            {"6222625420000311212"},
            {"622262953000740581"},
            {"6222650580003695108"},
            {"622277081229960575"},
            {"6223221203014313711"},
            {"6223263301023151250"},
            {"62244030817172510"},
            {"622480104067627151"},
            {"622488012724040619"},
            {"6225593202015827051"},
            {"6226620804783028"},
            {"622663260082645210"},
            {"6226802968291436622"},
            {"62268602438782309"},
            {"622700001124019411"},
            {"622700083290031701"},
            {"62270018328301236440"},
            {"6227002104010611916"},
            {"6227002199166163831"},
            {"62270033243100477377"},
            {"622700339100107202"},
            {"6227003413030048190"},
            {"622700381401002666119"},
            {"622700388140330044592"},
            {"6228400469839976872"},
            {"622840086485638471"},
            {"622840328229782672"},
            {"622840692112114774"},
            {"622841206300734467"},
            {"6228435979614813370"},
            {"6228450316004325665"},
            {"62284506888022090979"},
            {"622845074801626237"},
            {"622848001452213777"},
            {"6228480031674226214"},
            {"622848008396565117"},
            {"622848024047721116"},
            {"62284802467227164"},
            {"622848029435148179"},
            {"622848029443786878"},
            {"622848029478832077"},
            {"622848031637683779"},
            {"6228480322045720212"},
            {"622848033200674375"},
            {"6228480368022884373"},
            {"6228480405665999178"},
            {"6228480405828157171"},
            {"6228480409913258753"},
            {"622848047841329679"},
            {"6228480530662112715"},
            {"622848059772296477"},
            {"6228480609271414777"},
            {"622848064814090897"},
            {"6228480688118753271"},
            {"6228480739442771277"},
            {"622848076742861370"},
            {"6228480838789325770"},
            {"6228480838867786778"},
            {"6228480846040840364"},
            {"6228480898323076672"},
            {"6228481262211422522"},
            {"622848146968818877"},
            {"6228481534204213188"},
            {"6228481537828458074"},
            {"62284818240638672"},
            {"62284818490375573671"},
            {"6228481908226681497"},
            {"622848266105947960"},
            {"622848269221492572"},
            {"6228483056265990663"},
            {"6228483066594264062"},
            {"6228483078099931755"},
            {"622848318547872"},
            {"622848328430118771"},
            {"622848397827586274"},
            {"622848402840977697"},
            {"62284842479594342275"},
            {"622848626728571276"},
            {"62284862673963857"},
            {"6228486279206500273"},
            {"622848858786859976"},
            {"622848969411402577"},
            {"6228623106581345"},
            {"6228983368033970979"},
            {"622908323038302348"},
            {"622908576551033111"},
            {"623052001002453507"},
            {"623052010024535079"},
            {"623052068014815374"},
            {"623058000012878319"},
            {"623058000013478998"},
            {"6230944138002004761"},
            {"623573600002111129"},
            {"623575800000865733"},
            {"6236680010001418775"},
            {"6236680130006251077"},
            {"623668214600064477899"},
            {"62366825500023005266"},
            {"623668292005651821"},
            {"623668332000780058"},
            {"623668332007800584"},
            {"6256883100001070077"},
            {"6270029201171628841"},
            {"6270033200455921162"},
            {"6280000008000000222"},
            {"6280020998091229"},
            {"628480333167998111"},
            {"628481352283510018"},
            {"6366112600016504488"},
            {"6366832600009344533"},
            {"6366833200203820322"},
            {"66212261715002941831"},
            {"66227000301430275516"},
            {"6622848009480341313"},
            {"6622848032317609617"},
            {"8228480329458044271"},
            {"8228480841076999918"},
            {"82840128469874773"},
            {"888459869038658733"},
            {"9226621105618837"},
            {"955882202000330378"},
            {"?6228480378408245371?"},
            {"?6228482478396320570?"},
        };
    }

    @Test(dataProvider = "data")
    public void testValidate(String cardNo) {
        assertThat(BankCardNumberValidator.validate(cardNo)).isTrue();
    }
}
