Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions src/main/java/IntroLab.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public class IntroLab {
/**
* Returns a message depending on the given greeting, name, message, and
* whether the caller likes cats or dogs more.
*
* Do NOT change this method!
*
* @param greeting A string with a greeting (e.g. "Hello", "Hey")
Expand Down Expand Up @@ -41,9 +40,17 @@ public static String printLabMessage(String greeting, String name,
* Make sure you document your method properly!
*/

/**
* An example method that calls on printLabMessage.
*/
public static String lungerjo() {

return printLabMessage("Hi", "Josh Lunger", false,
"I am looking forward to designing some software!");
}

public static String huyizhi1() {
return printLabMessage("Hi", "Mason Hu", false,
"I am looking forward to designing some software!");
}

public static String exampleStudent() {
return printLabMessage("Hello", "Stu Dent", true,
"Welcome to CSC207!");
Expand All @@ -60,6 +67,9 @@ public static void main(final String[] args) {
* above. Afterwards: run this file to see the output!
*/

String message = lungerjo();
System.out.println(message);


}

Expand Down
18 changes: 18 additions & 0 deletions src/test/java/IntroLabTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,27 @@ public void testExampleStudent() {
assertEquals(expected, actual);
}


/* TODO: Write a test case for the method you wrote in IntroLab.
* If done properly, you should be able to run IntroLabTest and see
* the test results.
* As a reference, we've included testExampleStudent above.
*/

@Test
public void testMessage(){
String expected = "Hi! My name is Josh Lunger! " +
"I like dogs more than cats! I am looking forward to designing some software!";
String actual = IntroLab.lungerjo();
assertEquals(expected, actual);
}

@Test
public void testhuyizhi1() {
String expected = "Hi! My name is Mason Hu! " +
"I like dogs more than cats! I am looking forward to designing some software!";
String actual = IntroLab.huyizhi1();
assertEquals(expected, actual);
}

}