From 10f5c984863c168f4d934af0820409b769f19d55 Mon Sep 17 00:00:00 2001 From: Imron Date: Wed, 16 Feb 2022 17:20:58 +0100 Subject: [PATCH] bank transaction validation --- .../java/hs/fulda/de/ci/exam/project/PaymentTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/java/hs/fulda/de/ci/exam/project/PaymentTest.java b/src/test/java/hs/fulda/de/ci/exam/project/PaymentTest.java index 4a8e535..f5fa7b4 100644 --- a/src/test/java/hs/fulda/de/ci/exam/project/PaymentTest.java +++ b/src/test/java/hs/fulda/de/ci/exam/project/PaymentTest.java @@ -34,5 +34,15 @@ public class PaymentTest { assertEquals(Failed, credit_card_payment.status); } + @Test + public void paymentShould_not_be_possible_if_iban_is_wrong(){ + BankTransaction bank_payment = new BankTransaction(11, "139€", Unpaid, "Sparkasse Fulda", "DE012"); + FlightReservation reservation = new FlightReservation(); + reservation.makePayment(bank_payment); + assertEquals(ReservationStatus.Cancelled, reservation.getStatus()); + assertEquals(Failed, bank_payment.status); + } + + }