diff --git a/src/main/java/IntroLab.java b/src/main/java/IntroLab.java index fa5d6e2..a3b1b28 100644 --- a/src/main/java/IntroLab.java +++ b/src/main/java/IntroLab.java @@ -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") @@ -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!"); @@ -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); + } diff --git a/src/test/java/IntroLabTest.java b/src/test/java/IntroLabTest.java index 4572da6..9cfa7ff 100644 --- a/src/test/java/IntroLabTest.java +++ b/src/test/java/IntroLabTest.java @@ -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); + } + }