From 3c4404ad9e4f3cf5fb56059fa26a017cf44565b9 Mon Sep 17 00:00:00 2001 From: Imron Date: Mon, 24 Jan 2022 13:46:24 +0100 Subject: [PATCH] getCode() --- src/main/java/hs/fulda/de/ci/exam/project/Airport.java | 5 +++++ .../hs/fulda/de/ci/exam/project/AirportClassTest.java | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/hs/fulda/de/ci/exam/project/Airport.java b/src/main/java/hs/fulda/de/ci/exam/project/Airport.java index 6ea009f..03173a0 100644 --- a/src/main/java/hs/fulda/de/ci/exam/project/Airport.java +++ b/src/main/java/hs/fulda/de/ci/exam/project/Airport.java @@ -2,9 +2,14 @@ package hs.fulda.de.ci.exam.project; public class Airport { + protected String code; protected String name; public String getName() { return this.name; } + + public String getCode() { + return this.code; + } } diff --git a/src/test/java/hs/fulda/de/ci/exam/project/AirportClassTest.java b/src/test/java/hs/fulda/de/ci/exam/project/AirportClassTest.java index 0fabcc5..101063d 100644 --- a/src/test/java/hs/fulda/de/ci/exam/project/AirportClassTest.java +++ b/src/test/java/hs/fulda/de/ci/exam/project/AirportClassTest.java @@ -9,6 +9,14 @@ public class AirportClassTest { void test_getName(){ Airport airport = new Airport(); airport.name = "fraport"; - assertThat(airport.getName()).describedAs("get list of Flights").isEqualTo("fraport"); + assertThat(airport.getName()).describedAs("get airport name").isEqualTo("fraport"); } + + @Test + void test_getCode(){ + Airport airport = new Airport(); + airport.code = "PC994"; + assertThat(airport.getCode()).describedAs("get airport code").isEqualTo("PC994"); + } + }