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
8 changes: 7 additions & 1 deletion src/main/java/IntroLab.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ 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 syedtah3(String greeting, String name,
boolean likes_cats, String message,
String student_course){
String second_message = printLabMessage(greeting, name, likes_cats, message) + " I'm taking the course " + student_course + ".";
return second_message;
}

/**
* An example method that calls on printLabMessage.
Expand All @@ -51,7 +57,7 @@ public static String exampleStudent() {


public static void main(final String[] args) {
System.out.println(exampleStudent());
System.out.println(syedtah3("How you doing", "Drake", false, "Welcome to CSC207!", "CSC207"));

/* TODO: Add a call to the method you wrote in this main method,
* and print the results of it.
Expand Down
8 changes: 8 additions & 0 deletions src/test/java/IntroLabTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ public void testExampleStudent() {
assertEquals(expected, actual);
}

@Test(timeout = 10)
public void syedtah3() {
String expected = "How you doing! My name is Drake! " +
"I like dogs more than cats! Welcome to CSC207! I'm taking the course CSC207.";
String actual = IntroLab.syedtah3("How you doing", "Drake", false, "Welcome to CSC207!", "CSC207");
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.
Expand Down