Compare commits

...

1 Commits

Author SHA1 Message Date
Maxim Volkov 88cf31baac Feature: Title to Uppercase 3 years ago
  1. 9
      hello-world/src/main/java/de/hs_fulda/ciip/hello_world/App.java
  2. 16
      hello-world/src/test/java/de/hs_fulda/ciip/hello_world/AppTest.java

9
hello-world/src/main/java/de/hs_fulda/ciip/hello_world/App.java

@ -13,6 +13,7 @@ public class App
private String firstName; private String firstName;
private String lastName; private String lastName;
private String title;
public void setFirstName(String firstName) { public void setFirstName(String firstName) {
this.firstName = firstName; this.firstName = firstName;
@ -25,5 +26,13 @@ public class App
public String getFullName() { public String getFullName() {
return firstName + " " + lastName; return firstName + " " + lastName;
} }
public void setTitle(String title) {
this.title = title.toUpperCase();
}
public String getTitle() {
return title;
}
} }

16
hello-world/src/test/java/de/hs_fulda/ciip/hello_world/AppTest.java

@ -31,7 +31,6 @@ public class AppTest extends TestCase {
assertTrue(true); assertTrue(true);
} }
public void testFullName() { public void testFullName() {
// Arrange // Arrange
String expected = "Maxim Volkov"; String expected = "Maxim Volkov";
@ -47,4 +46,19 @@ public class AppTest extends TestCase {
// Assert // Assert
assertEquals(expected, actual); assertEquals(expected, actual);
} }
public void testIsTitle() {
// Arrange
String expectedTitleUppercase = "NICE";
String title = "nIcE";
// Act
App m = new App();
m.setTitle(title);
String actual = m.getTitle();
// Assert
assertEquals(expectedTitleUppercase, actual);
}
} }
Loading…
Cancel
Save