Browse Source

Feature: Title to Uppercase

feature-pr/transform-to-title
Maxim Volkov 2 years ago
parent
commit
88cf31baac
  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 lastName;
private String title;
public void setFirstName(String firstName) {
this.firstName = firstName;
@ -25,5 +26,13 @@ public class App
public String getFullName() {
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);
}
public void testFullName() {
// Arrange
String expected = "Maxim Volkov";
@ -47,4 +46,19 @@ public class AppTest extends TestCase {
// Assert
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