diff --git a/src/main/java/IntroLab.java b/src/main/java/IntroLab.java index fa5d6e2..a2bd59f 100644 --- a/src/main/java/IntroLab.java +++ b/src/main/java/IntroLab.java @@ -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. @@ -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. diff --git a/src/test/java/IntroLabTest.java b/src/test/java/IntroLabTest.java index 4572da6..567c751 100644 --- a/src/test/java/IntroLabTest.java +++ b/src/test/java/IntroLabTest.java @@ -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.