commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dgra...@apache.org
Subject cvs commit: jakarta-commons/validator/src/test/org/apache/commons/validator CreditCardValidatorTest.java
Date Sun, 08 Jun 2003 21:54:07 GMT
dgraham     2003/06/08 14:54:07

  Modified:    validator/src/test/org/apache/commons/validator
                        CreditCardValidatorTest.java
  Log:
  Added more credit card tests.
  
  Revision  Changes    Path
  1.2       +9 -3      jakarta-commons/validator/src/test/org/apache/commons/validator/CreditCardValidatorTest.java
  
  Index: CreditCardValidatorTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/validator/src/test/org/apache/commons/validator/CreditCardValidatorTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CreditCardValidatorTest.java	8 Jun 2003 21:33:22 -0000	1.1
  +++ CreditCardValidatorTest.java	8 Jun 2003 21:54:07 -0000	1.2
  @@ -84,7 +84,13 @@
           assertFalse(ccv.isValid(""));
           assertFalse(ccv.isValid("123456789012"));   // too short
           assertFalse(ccv.isValid("12345678901234567890"));   // too long
  +        assertFalse(ccv.isValid("4417123456789112"));
  +        assertFalse(ccv.isValid("4417q23456w89113"));
  +        assertTrue(ccv.isValid("4417123456789113"));
           
  +        // disallow Visa so it should fail even with good number
  +        ccv = new CreditCardValidator(CreditCardValidator.AMEX);
  +        assertFalse(ccv.isValid("4417123456789113"));
   	}
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message