Browse Source

address toString tested

feature-Address
Imron 3 years ago
parent
commit
46b7d8467e
  1. 8
      src/main/java/hs/fulda/de/ci/exam/project/Address.java
  2. 12
      src/test/java/hs/fulda/de/ci/exam/project/AddressTest.java
  3. BIN
      target/classes/hs/fulda/de/ci/exam/project/Address.class
  4. BIN
      target/classes/hs/fulda/de/ci/exam/project/Airport.class
  5. BIN
      target/test-classes/hs/fulda/de/ci/exam/project/AddressTest.class
  6. BIN
      target/test-classes/hs/fulda/de/ci/exam/project/AirportTest.class

8
src/main/java/hs/fulda/de/ci/exam/project/Address.java

@ -17,12 +17,6 @@ public class Address {
@Override @Override
public String toString() { public String toString() {
return "Address{" +
"streetAddress='" + streetAddress + '\'' +
", city='" + city + '\'' +
", state='" + state + '\'' +
", zipCode='" + zipCode + '\'' +
", country='" + country + '\'' +
'}';
return streetAddress + ", " + city + ", " + state + ", " + zipCode + ", " + country;
} }
} }

12
src/test/java/hs/fulda/de/ci/exam/project/AddressTest.java

@ -1,17 +1,13 @@
package hs.fulda.de.ci.exam.project; package hs.fulda.de.ci.exam.project;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import static org.assertj.core.api.Assertions.*;
class AddressTest { class AddressTest {
@BeforeEach
void setUp() {
}
@Test @Test
void testToString() {
void testToString_Adress() {
Address address_fr = new Address("Frankfurt str 12", "Frankfurt", "Hessen", "63023", "Germany");
assertThat(address_fr.toString()).describedAs(" get address ").isEqualTo("Frankfurt str 12, Frankfurt, Hessen, 63023, Germany");
} }
} }

BIN
target/classes/hs/fulda/de/ci/exam/project/Address.class

BIN
target/classes/hs/fulda/de/ci/exam/project/Airport.class

BIN
target/test-classes/hs/fulda/de/ci/exam/project/AddressTest.class

BIN
target/test-classes/hs/fulda/de/ci/exam/project/AirportTest.class

Loading…
Cancel
Save