|
1 | 1 | package seedu.address.logic.commands.meetings; |
2 | 2 |
|
3 | | -import seedu.address.commons.core.index.Index; |
4 | | -import seedu.address.model.Model; |
5 | | -import seedu.address.model.meeting.Meeting; |
6 | | -import seedu.address.model.meeting.NameContainsKeywordsPredicate; |
7 | | - |
8 | | -import java.util.Arrays; |
9 | | - |
10 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; |
11 | 4 | import static org.junit.jupiter.api.Assertions.assertTrue; |
12 | 5 | import static seedu.address.logic.parser.CliSyntax.PREFIX_DESCRIPTION; |
|
16 | 9 | import static seedu.address.logic.parser.CliSyntax.PREFIX_PRIORITY; |
17 | 10 | import static seedu.address.logic.parser.CliSyntax.PREFIX_START_TIME; |
18 | 11 |
|
| 12 | +import java.util.Arrays; |
| 13 | + |
| 14 | +import seedu.address.commons.core.index.Index; |
| 15 | +import seedu.address.model.Model; |
| 16 | +import seedu.address.model.meeting.Meeting; |
| 17 | +import seedu.address.model.meeting.NameContainsKeywordsPredicate; |
| 18 | + |
| 19 | + |
19 | 20 |
|
20 | 21 | /** |
21 | 22 | * Contains helper methods for testing commands. |
@@ -56,69 +57,10 @@ public class MeetingCommandTestUtil { |
56 | 57 | public static final String INVALID_PRIORITY_DESC = " " + PREFIX_PRIORITY + "-2"; |
57 | 58 | public static final String INVALID_TAG_DESC = " " + PREFIX_GROUP + "hubby*"; // '*' not allowed in tags |
58 | 59 |
|
59 | | - |
60 | | -// |
61 | | -// public static final String PREAMBLE_WHITESPACE = "\t \r \n"; |
62 | | -// public static final String PREAMBLE_NON_EMPTY = "NonEmptyPreamble"; |
63 | | -// |
64 | | -// public static final EditPersonCommand.EditPersonDescriptor DESC_AMY; |
65 | | -// public static final EditPersonCommand.EditPersonDescriptor DESC_BOB; |
66 | | -// |
67 | | -// static { |
68 | | -// DESC_AMY = new EditPersonDescriptorBuilder().withName(VALID_NAME_AMY) |
69 | | -// .withPhone(VALID_PHONE_AMY).withEmail(VALID_EMAIL_AMY).withAddress(VALID_ADDRESS_AMY) |
70 | | -// .withTags(VALID_TAG_FRIEND).build(); |
71 | | -// DESC_BOB = new EditPersonDescriptorBuilder().withName(VALID_NAME_BOB) |
72 | | -// .withPhone(VALID_PHONE_BOB).withEmail(VALID_EMAIL_BOB).withAddress(VALID_ADDRESS_BOB) |
73 | | -// .withTags(VALID_TAG_HUSBAND, VALID_TAG_FRIEND).build(); |
74 | | -// } |
75 | | - |
76 | | -// /** |
77 | | -// * Executes the given {@code command}, confirms that <br> |
78 | | -// * - the returned {@link CommandResult} matches {@code expectedCommandResult} <br> |
79 | | -// * - the {@code actualModel} matches {@code expectedModel} |
80 | | -// */ |
81 | | -// public static void assertCommandSuccess(Command command, Model actualModel, CommandResult expectedCommandResult, |
82 | | -// Model expectedModel) { |
83 | | -// try { |
84 | | -// CommandResult result = command.execute(actualModel); |
85 | | -// assertEquals(expectedCommandResult, result); |
86 | | -// assertEquals(expectedModel, actualModel); |
87 | | -// } catch (CommandException ce) { |
88 | | -// throw new AssertionError("Execution of command should not fail.", ce); |
89 | | -// } |
90 | | -// } |
91 | | -// |
92 | | -// /** |
93 | | -// * Convenience wrapper to {@link #assertCommandSuccess(Command, Model, CommandResult, Model)} |
94 | | -// * that takes a string {@code expectedMessage}. |
95 | | -// */ |
96 | | -// public static void assertCommandSuccess(Command command, Model actualModel, String expectedMessage, |
97 | | -// Model expectedModel) { |
98 | | -// CommandResult expectedCommandResult = new CommandResult(expectedMessage); |
99 | | -// assertCommandSuccess(command, actualModel, expectedCommandResult, expectedModel); |
100 | | -// } |
101 | | -// |
102 | | -// /** |
103 | | -// * Executes the given {@code command}, confirms that <br> |
104 | | -// * - a {@code CommandException} is thrown <br> |
105 | | -// * - the CommandException message matches {@code expectedMessage} <br> |
106 | | -// * - the address book, filtered person list and selected person in {@code actualModel} remain unchanged |
107 | | -// */ |
108 | | -// public static void assertCommandFailure(Command command, Model actualModel, String expectedMessage) { |
109 | | -// // we are unable to defensively copy the model for comparison later, so we can |
110 | | -// // only do so by copying its components. |
111 | | -// AddressBook expectedAddressBook = new AddressBook(actualModel.getAddressBook()); |
112 | | -// List<Person> expectedFilteredList = new ArrayList<>(actualModel.getFilteredPersonList()); |
113 | | -// |
114 | | -// assertThrows(CommandException.class, expectedMessage, () -> command.execute(actualModel)); |
115 | | -// assertEquals(expectedAddressBook, actualModel.getAddressBook()); |
116 | | -// assertEquals(expectedFilteredList, actualModel.getFilteredPersonList()); |
117 | | -// } |
118 | | - /** |
119 | | - * Updates {@code model}'s filtered meetings list to show only the meeting at the given {@code targetIndex} in the |
120 | | - * {@code model}'s meeting book. It is mandatory for this case meeting names are unique with respect to their first |
121 | | - * word in their name. |
| 60 | + /** |
| 61 | + * Updates {@code model}'s filtered meetings list to show only the meeting at the given {@code targetIndex} in the |
| 62 | + * {@code model}'s meeting book. It is mandatory for this case meeting names are unique with respect to their first |
| 63 | + * word in their name. |
122 | 64 | */ |
123 | 65 | public static void showMeetingAtIndex(Model model, Index targetIndex) { |
124 | 66 | assertTrue(targetIndex.getZeroBased() < model.getFilteredMeetingList().size()); |
|
0 commit comments