Skip to content

Commit

Permalink
Move name up in toString()
Browse files Browse the repository at this point in the history
  • Loading branch information
sualeh committed Dec 26, 2023
1 parent 0da264b commit 1df1112
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/main/java/us/fatehi/creditcardnumber/BankCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,16 @@ public String toString() {
buffer.append(" Is Primary Account Number Valid? ");
buffer.append(pan.isPrimaryAccountNumberValid() ? "Yes" : "No").append(NEWLINE);
}
if (hasName()) {
buffer.append(" Name: ");
buffer.append(getName()).append(NEWLINE);
}
if (hasExpirationDate()) {
buffer.append(" Expiration Date: ");
buffer.append(expirationDate).append(NEWLINE);
buffer.append(" Is Expired? ");
buffer.append(expirationDate.isExpired() ? "Yes" : "No").append(NEWLINE);
}
if (hasName()) {
buffer.append(" Name: ");
buffer.append(getName()).append(NEWLINE);
}
if (hasServiceCode()) {
final ServiceCode serviceCode = getServiceCode();
buffer.append(" Service Code: ");
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/BankCard.toString
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Bank Card Information:
Last Four Digits: 6173
Passes Luhn Check? No
Is Primary Account Number Valid? No
Name: Sualeh Fatehi
Expiration Date: 2012-12
Is Expired? Yes
Name: Sualeh Fatehi
Service Code:
2 - Interchange: International interchange. Technology: Integrated circuit card.
2 - Authorization Processing: By issuer.
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/BankCard1.toString
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Bank Card Information:
Last Four Digits: 6173
Passes Luhn Check? No
Is Primary Account Number Valid? No
Name: Sualeh Fatehi
Expiration Date: 2012-12
Is Expired? Yes
Name: Sualeh Fatehi

2 changes: 1 addition & 1 deletion src/test/resources/BankCard5.toString
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Bank Card Information:
Last Four Digits: 6174
Passes Luhn Check? Yes
Is Primary Account Number Valid? Yes
Name: Sualeh Fatehi
Expiration Date: 2030-12
Is Expired? No
Name: Sualeh Fatehi
Service Code:
2 - Interchange: International interchange. Technology: Integrated circuit card.
2 - Authorization Processing: By issuer.
Expand Down

0 comments on commit 1df1112

Please sign in to comment.