Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LiamOdero pull request #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
7 changes: 4 additions & 3 deletions src/main/java/IntroLab.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@
* You should read this file from top-to-bottom. Any tasks you are to complete
* are labelled with TODO!
*/

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")
* @param name A string with a name (e.g. "Jonathan", "Lindsey")
* @param likes_cats A boolean: true if they like cats more than dogs,
Expand Down Expand Up @@ -41,6 +38,10 @@ public static String printLabMessage(String greeting, String name,
* Make sure you document your method properly!
*/

public static String oderolia() {
return printLabMessage("Salutations", "Liam Odero", false, "message");
}

/**
* An example method that calls on printLabMessage.
*/
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 testPersonalMethod() {
String expected = "Salutations! My name is Liam Odero! I like dogs more than cats! message";
String actual = IntroLab.oderolia();
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