package Ġbr . com . wire card . des mond . bank . validator . bank Ċ Ċ import Ġbr . com . wire card . des mond . bank . Bank Ċ import Ġbr . com . wire card . des mond . bank . Bank Account Ċ import Ġbr . com . wire card . des mond . bank . exception . Empty Check Digit Exception Ċ import Ġbr . com . wire card . des mond . bank . exception . Invalid Check Digit Exception Ċ import Ġcom . w inter be . ex pe kt . should Ċ import Ġorg . junit . Test Ċ Ċ import Ġbr . com . wire card . des mond . bank . factory . S ant ander ObjectFactory Ġas Ġobject Factory Ċ import Ġbr . com . wire card . des mond . bank . validator . bank . S ant ander Bank Account Validator Ġas Ġvalidator Ċ Ċ class ĠS ant ander Bank Account Validator Test Ġ{ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun ĠshouldBe True For Valid Ag ency And Account () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġvalid Ag ency Number Ġ= Ġobject Factory . VALID _ AG ENCY _ NUMBER ĊĠĠĠĠĠĠĠ Ġval Ġvalid Account Number Ġ= Ġobject Factory . VALID _ ACCOUNT _ NUMBER ĊĠĠĠĠĠĠĠ Ġval Ġvalid Check Digit Ġ= Ġobject Factory . VALID _ CHECK _ DIGIT ĊĠĠĠĠĠĠĠ Ġval Ġbank Account Ġ= ĠBank Account ( Bank . S ant ander , Ġvalid Ag ency Number , Ġvalid Check Digit , Ġvalid Account Number , Ġvalid Check Digit ) ĊĠĠĠĠĠĠĠ Ġvalidator . validate ( bank Account ). should . be .` true ` ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ( expected Ġ= ĠInvalid Check Digit Exception :: class ) ĊĠĠĠ Ġfun Ġshould Throw Correct Exception For Invalid Account Check Digit () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġvalid Ag ency Number Ġ= Ġobject Factory . VALID _ AG ENCY _ NUMBER ĊĠĠĠĠĠĠĠ Ġval Ġvalid Account Number Ġ= Ġobject Factory . VALID _ ACCOUNT _ NUMBER ĊĠĠĠĠĠĠĠ Ġval Ġinvalid Account Check Digit Ġ= Ġobject Factory . INVALID _ CHECK _ DIGIT ĊĠĠĠĠĠĠĠ Ġval Ġbank Account Ġ= ĠBank Account ( Bank . S ant ander , Ġvalid Ag ency Number , Ġvalid Account Number , Ġinvalid Account Check Digit ) ĊĠĠĠĠĠĠĠ Ġvalidator . validate ( bank Account ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ( expected Ġ= ĠEmpty Check Digit Exception :: class ) ĊĠĠĠ Ġfun Ġshould Throw Correct Exception When Ag ency Check Digit IsEmpty () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġvalid Ag ency Number Ġ= Ġobject Factory . VALID _ AG ENCY _ NUMBER ĊĠĠĠĠĠĠĠ Ġval Ġvalid Account Number Ġ= Ġobject Factory . VALID _ ACCOUNT _ NUMBER ĊĠĠĠĠĠĠĠ Ġval Ġinvalid Account Check Digit Ġ= Ġobject Factory . INVALID _ EMPTY _ CHECK _ DIGIT ĊĠĠĠĠĠĠĠ Ġval Ġbank Account Ġ= ĠBank Account ( Bank . B anco Do Br as il , Ġvalid Ag ency Number , Ġvalid Account Number , Ġinvalid Account Check Digit ) ĊĠĠĠĠĠĠĠ Ġvalidator . validate ( bank Account ) ĊĠĠĠ Ġ} Ċ }