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
5 changes: 5 additions & 0 deletions src/main/java/IntroLab.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ public static String printLabMessage(String greeting, String name,
* As a reference, we've provided the sample method exampleStudent.
* Make sure you document your method properly!
*/
public static String wang1978() {
return printLabMessage("Hello", "Jerry", true,
"Welcome to CSC207!");
}

/**
* An example method that calls on printLabMessage.
Expand All @@ -59,6 +63,7 @@ public static void main(final String[] args) {
* As a reference, we've provided a sample call to exampleStudent
* above. Afterwards: run this file to see the output!
*/
System.out.println(wang1978());


}
Expand Down
15 changes: 8 additions & 7 deletions src/test/java/IntroLabTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@ public void setUp() {
public void tearDown() {
}

@Test(timeout = 10)
@Test
public void testExampleStudent() {
String expected = "Hello! My name is Stu Dent! " +
"I like cats more than dogs! Welcome to CSC207!";
String actual = IntroLab.exampleStudent();
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 testMyCode() {
String expected = "Hello! My name is Jerry! I like cats more than dogs! Welcome to CSC207!";
String actual = IntroLab.wang1978();
assertEquals(expected, actual);
}
}