Skip to content

Commit

Permalink
AddedTestCases
Browse files Browse the repository at this point in the history
  • Loading branch information
lynnlow175 committed Oct 13, 2023
1 parent 2d526d4 commit 6dec987
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/main/java/seedu/lovebook/logic/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public class Messages {
public static final String MESSAGE_PERSONS_LISTED_OVERVIEW = "%1$d dates listed!";
public static final String MESSAGE_DUPLICATE_FIELDS =
"Multiple values specified for the following single-valued field(s): ";
public static final String WELCOME_MESSAGE = "Hey there, fabulous single!" + "\n"
+ "Get ready to embark on an exciting journey with LoveBook to find your perfect match ❤︎₊ ⊹";

/**
* Returns an error message indicating the duplicate prefixes.
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/seedu/lovebook/model/ModelManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import javafx.collections.transformation.FilteredList;
import seedu.lovebook.commons.core.GuiSettings;
import seedu.lovebook.commons.core.LogsCenter;
import seedu.lovebook.logic.Messages;
import seedu.lovebook.model.person.Date;

/**
Expand Down Expand Up @@ -130,8 +131,7 @@ public void updateFilteredPersonList(Predicate<Date> predicate) {

@Override
public String getWelcomeMessage() {
return "Hey there, fabulous single!" + "\n"
+ "Get ready to embark on an exciting journey with LoveBook to find your perfect match ❤︎₊ ⊹";
return Messages.WELCOME_MESSAGE;
}

@Override
Expand Down
7 changes: 7 additions & 0 deletions src/test/java/seedu/lovebook/logic/LogicManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ public void getFilteredPersonList_modifyList_throwsUnsupportedOperationException
assertThrows(UnsupportedOperationException.class, () -> logic.getFilteredPersonList().remove(0));
}

@Test
public void executeGetWelcomeMessage() {
String expected = "Hey there, fabulous single!" + "\n"
+ "Get ready to embark on an exciting journey with LoveBook to find your perfect match ❤︎₊ ⊹";
assertEquals(expected, logic.getWelcomeMessage());
}

/**
* Executes the command and confirms that
* - no exceptions are thrown <br>
Expand Down
7 changes: 7 additions & 0 deletions src/test/java/seedu/lovebook/model/ModelManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ public void getFilteredPersonList_modifyList_throwsUnsupportedOperationException
assertThrows(UnsupportedOperationException.class, () -> modelManager.getFilteredPersonList().remove(0));
}

@Test
public void executeWelcomeMessage() {
String expected = "Hey there, fabulous single!" + "\n"
+ "Get ready to embark on an exciting journey with LoveBook to find your perfect match ❤︎₊ ⊹";
assertEquals(expected, modelManager.getWelcomeMessage());
}

@Test
public void equals() {
LoveBook loveBook = new LoveBookBuilder().withPerson(ALICE).withPerson(BENSON).build();
Expand Down

0 comments on commit 6dec987

Please sign in to comment.