add class

This commit is contained in:
Alexey Metlyakov
2021-03-14 16:36:40 +03:00
parent 5a61f63c8a
commit be448400d2
3 changed files with 36 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
package hello;
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());
}
}

View File

@@ -0,0 +1,7 @@
package hello;
public class Welcomer{
public String sayWelcome() {
return "Welcome back, Good Hunter!";
}
}

View File

@@ -0,0 +1,17 @@
package hello;
import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.*;
import org.junit.Test;
public class WelcomerTest {
private Welcomer welcomer = new Welcomer();
@Test
public void welcomerSaysWelcome() {
assertThat(welcomer.sayWelcome(), containsString("Welcome"));
}
}