Browse Source

bank transaction

feature-pr-feature-paymentOptions
Imron 3 years ago
parent
commit
442036d542
  1. 28
      src/main/java/hs/fulda/de/ci/exam/project/BankTransaction.java
  2. 11
      src/test/java/hs/fulda/de/ci/exam/project/PaymentTest.java

28
src/main/java/hs/fulda/de/ci/exam/project/BankTransaction.java

@ -0,0 +1,28 @@
package hs.fulda.de.ci.exam.project;
public class BankTransaction extends Payment {
String bankName;
String iban;
public BankTransaction(int id, String amount, PaymentStatus status, String bankName, String iban) {
super(id, amount, status);
this.bankName = bankName;
this.iban = iban;
}
public String getBankName() {
return bankName;
}
public void setBankName(String bankName) {
this.bankName = bankName;
}
public String getIban() {
return iban;
}
public void setIban(String iban) {
this.iban = iban;
}
}

11
src/test/java/hs/fulda/de/ci/exam/project/PaymentTest.java

@ -15,4 +15,15 @@ public class PaymentTest {
assertEquals(Confirmed, reservation.getStatus());
assertEquals(Completed, credit_card_payment.status);
}
@Test
public void should_be_possible_to_pay_with_bank_account(){
FlightReservation reservation = new FlightReservation();
BankTransaction payment = new BankTransaction(11, "139€", Unpaid, "Sparkasse Fulda", "DE01234567890123456789");
reservation.makePayment(payment);
assertEquals(Confirmed, reservation.getStatus());
assertEquals(Completed, payment.status);
}
}
Loading…
Cancel
Save