File tree 1 file changed +4
-0
lines changed
mad-lib/src/test/java/com/craftsmanshipinsoftware/madlib
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -16,15 +16,19 @@ class MadLibTest {
16
16
void printStory_GivenInputIsMissing_ShouldAskForMissingInput (String input ) {
17
17
ByteArrayOutputStream outputStream = new ByteArrayOutputStream ();
18
18
MadLib madLib = new MadLib (new ByteArrayInputStream (input .getBytes ()), new PrintStream (outputStream ));
19
+
19
20
madLib .printStory ();
21
+
20
22
assertThat (outputStream ).hasToString ("Please enter something as input!" + System .lineSeparator ());
21
23
}
22
24
23
25
@ Test
24
26
void printStory_GivenAllNeededInput_ShouldPrintStory () {
25
27
ByteArrayOutputStream outputStream = new ByteArrayOutputStream ();
26
28
MadLib madLib = new MadLib (new ByteArrayInputStream ("dog\n walk\n blue\n quickly" .getBytes ()), new PrintStream (outputStream ));
29
+
27
30
madLib .printStory ();
31
+
28
32
assertThat (outputStream ).hasToString ("Do you walk your blue dog quickly? That's hilarious!" + System .lineSeparator ());
29
33
}
30
34
You can’t perform that action at this time.
0 commit comments