From 17e6f6e76c1c5bb5f131f2595a6a8dcc77f5f9d8 Mon Sep 17 00:00:00 2001 From: Imron Date: Mon, 31 Jan 2022 21:50:53 +0100 Subject: [PATCH] aircraft constructor name --- .../hs/fulda/de/ci/exam/project/Aircraft.java | 13 +++++++++++++ .../hs/fulda/de/ci/exam/project/AircraftTest.java | 15 +++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/main/java/hs/fulda/de/ci/exam/project/Aircraft.java create mode 100644 src/test/java/hs/fulda/de/ci/exam/project/AircraftTest.java diff --git a/src/main/java/hs/fulda/de/ci/exam/project/Aircraft.java b/src/main/java/hs/fulda/de/ci/exam/project/Aircraft.java new file mode 100644 index 0000000..c4fc3b1 --- /dev/null +++ b/src/main/java/hs/fulda/de/ci/exam/project/Aircraft.java @@ -0,0 +1,13 @@ +package hs.fulda.de.ci.exam.project; + +public class Aircraft { + private String name; + + public Aircraft(String name, String model, int manufacturingYear) { + this.name = name; + } + + public String getName() { + return this.name; + } +} diff --git a/src/test/java/hs/fulda/de/ci/exam/project/AircraftTest.java b/src/test/java/hs/fulda/de/ci/exam/project/AircraftTest.java new file mode 100644 index 0000000..1ee2bb0 --- /dev/null +++ b/src/test/java/hs/fulda/de/ci/exam/project/AircraftTest.java @@ -0,0 +1,15 @@ +package hs.fulda.de.ci.exam.project; + +import org.junit.Test; + +import static org.assertj.core.api.Assertions.*; + +public class AircraftTest { + @Test + public void testClassAircraftConstructorName(){ + Aircraft testAircraft = new Aircraft("Airbus", "Neo", 1990); + assertThat(testAircraft.getName()) + .describedAs("get the name of aircraft") + .isEqualTo("Airbus"); + } +}