Browse Source

cash transaction

feature-pr-feature-paymentOptions
Imron 3 years ago
parent
commit
92b1faa9c3
  1. 12
      src/main/java/hs/fulda/de/ci/exam/project/CashTransaction.java
  2. 9
      src/test/java/hs/fulda/de/ci/exam/project/PaymentTest.java

12
src/main/java/hs/fulda/de/ci/exam/project/CashTransaction.java

@ -0,0 +1,12 @@
package hs.fulda.de.ci.exam.project;
public class CashTransaction extends Payment {
public CashTransaction(int id, String amount, PaymentStatus status) {
super(id, amount, status);
}
@Override
public boolean isValid() {
return true;
}
}

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

@ -43,6 +43,15 @@ public class PaymentTest {
assertEquals(Failed, bank_payment.status); assertEquals(Failed, bank_payment.status);
} }
@Test
public void cashPaymentShouldBePossible(){
CashTransaction cash_payment = new CashTransaction(11, "139€", Unpaid);
FlightReservation reservation = new FlightReservation();
reservation.makePayment(cash_payment);
assertEquals(Confirmed, reservation.getStatus());
assertEquals(Completed, cash_payment.status);
}
} }
Loading…
Cancel
Save