add feature

This commit is contained in:
Alexey Metlyakov
2021-03-14 17:01:32 +03:00
parent c7b8ef7a18
commit 5295976ea8
4 changed files with 12 additions and 14 deletions

View File

@@ -1,12 +1,9 @@
package plaindoll;
import org.joda.time.LocalTime;
public class HelloPlayer{
public static void main(String[] args) {
LocalTime currentTime = new LocalTime();
System.out.println("The current local time is: " + currentTime);
Welcomer welcomer = new Welcomer();
System.out.println(welcomer.sayWelcome());
System.out.println(welcomer.sayFarewell());
}
}

View File

@@ -4,4 +4,7 @@ public class Welcomer{
public String sayWelcome() {
return "Welcome home, good hunter. What is it your desire?";
}
public String sayFarewell() {
return "Farewell, good hunter. May you find your worth in waking world.";
}
}

View File

@@ -13,5 +13,12 @@ public class WelcomerTest {
public void welcomerSaysWelcome() {
assertThat(welcomer.sayWelcome(), containsString("Welcome"));
}
public void welcomerSaysFarewell() {
assertThat(welcomer.sayFarewell(), containsString("Farewell"));
}
public void welcomerSaysHunter() {
assertThat(welcomer.SaysWelcome(), containsString("hunter"));
assertThat(welcomer.sayFarewell(), containsString("hunter"));
}
}