add gold method

This commit is contained in:
Alexey Metlyakov
2022-06-06 21:35:24 +03:00
parent 123b01182e
commit b250d2c5ef
2 changed files with 7 additions and 0 deletions

View File

@@ -7,4 +7,7 @@ public class Welcomer{
public String sayFarewell() { public String sayFarewell() {
return "Farewell, good hunter. May you find your worth in waking world."; return "Farewell, good hunter. May you find your worth in waking world.";
} }
public String sayNeedGold(){
return "Not enough gold";
}
} }

View File

@@ -22,4 +22,8 @@ public class WelcomerTest {
assertThat(welcomer.sayWelcome(), containsString("hunter")); assertThat(welcomer.sayWelcome(), containsString("hunter"));
assertThat(welcomer.sayFarewell(), containsString("hunter")); assertThat(welcomer.sayFarewell(), containsString("hunter"));
} }
@Test
public void welcomerSaysSilver(){
assertThat(welcomer.sayNeedGold(), containsString("silver"));
}
} }