Exemple #1
0
 /**
  * Print information of a card
  *
  * @param c The card whose information is to be printed
  */
 public static void printCard(CreditCard c) { // Print a card's information
   System.out.println();
   System.out.println("Number = " + c.getNumber());
   System.out.println("Name = " + c.getName());
   System.out.println("Bank = " + c.getBank());
   System.out.println("Balance = " + c.getBalance()); // Implicit cast
   System.out.println("Limit = " + c.getLimit()); // Implicit cast
   System.out.println();
 }
 @Test(groups = "unit")
 public void testConstruction() {
   CreditCard creditCard = createDummyCreditCard();
   Assert.assertEquals(creditCard.getCvv2(), CVV2);
   Assert.assertEquals(creditCard.getExpireMonth(), EXPMONTH);
   Assert.assertEquals(creditCard.getExpireYear(), EXPYEAR);
   Assert.assertEquals(creditCard.getFirstName(), FIRSTNAME);
   Assert.assertEquals(creditCard.getLastName(), LASTNAME);
   Assert.assertEquals(creditCard.getNumber(), NUMBER);
   Assert.assertEquals(creditCard.getType(), TYPE);
   Assert.assertEquals(creditCard.getBillingAddress().getCity(), AddressTestCase.CITY);
   Assert.assertEquals(creditCard.getId(), ID);
   Assert.assertEquals(creditCard.getExternalCustomerId(), EXTERNAL_CUSTOMER_ID);
   Assert.assertEquals(creditCard.getState(), STATE);
   Assert.assertEquals(creditCard.getValidUntil(), VALIDUNTIL);
   Assert.assertEquals(creditCard.getLinks().size(), 1);
 }