diff --git a/src/main/java/hs/fulda/de/ci/exam/project/Airline.java b/src/main/java/hs/fulda/de/ci/exam/project/Airline.java index fb48233..aa9d0fb 100644 --- a/src/main/java/hs/fulda/de/ci/exam/project/Airline.java +++ b/src/main/java/hs/fulda/de/ci/exam/project/Airline.java @@ -2,9 +2,11 @@ package hs.fulda.de.ci.exam.project; public class Airline { private String name; + private String code; public Airline(String name, String code) { this.name = name; + this.code = code; } public String getName() { @@ -14,4 +16,12 @@ public class Airline { public void setName(String name) { this.name = name; } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } } diff --git a/src/test/java/hs/fulda/de/ci/exam/project/AirlineTest.java b/src/test/java/hs/fulda/de/ci/exam/project/AirlineTest.java index cc81361..e4ee951 100644 --- a/src/test/java/hs/fulda/de/ci/exam/project/AirlineTest.java +++ b/src/test/java/hs/fulda/de/ci/exam/project/AirlineTest.java @@ -14,4 +14,9 @@ public class AirlineTest { Airline airline = new Airline("Pegasus", "1234"); assertThat(airline.getName()).describedAs("name of airline").isEqualTo("Pegasus"); } + @Test + void testConstructorSetsCodeParameterCorrectly(){ + Airline airline = new Airline("Pegasus", "1234"); + assertThat(airline.getCode()).describedAs("code of airline").isEqualTo("1234"); + } }