Skip to content

Commit 91c802f

Browse files
authored
Merge pull request #139 from CS2103AUG2016-W13-C4/refactor-more-hx
Refactor more hx
2 parents 955d993 + 876d800 commit 91c802f

File tree

2 files changed

+36
-41
lines changed

2 files changed

+36
-41
lines changed

docs/DeveloperGuide.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ is better than these alternatives.<br>
280280
a. Include those libraries in the repo (this bloats the repo size)<br>
281281
b. Require developers to download those libraries manually (this creates extra work for developers)<br>
282282

283-
//@@author A0139655U
283+
<!-- @@author A0139655U -->
284284
## Appendix A : User Stories
285285

286286
Priorities: High - `* * *` Medium - `* *` Low - `*`
@@ -309,13 +309,15 @@ Priority | As a ... | I want to ... | So that I can...
309309

310310
(For all use cases below, the **System** is the `Task Manager` and the **Actor** is the `user`, unless specified otherwise)
311311

312+
<!-- @@author A0139655U -->
312313
#### Use case: UC01 - Add a task
313314

314315
**MSS**
315316

316317
1. User enters an `add` command, specifying details of the task to be added
317318
2. TaskManager parses the `add` command, and adds the task to the current task list
318319
3. TaskManager saves the current task list to storage and updates the GUI to display the updated list with the newly added task<br>
320+
319321
Use case ends
320322

321323
**Extensions**
@@ -333,8 +335,11 @@ Use case resumes at step 2
333335

334336
3a. User identifies a mistake in the details of the task added
335337
> 3a1. User edits the task details (UC03)<br>
336-
Use case ends
337338
339+
> Use case ends
340+
341+
342+
<!-- @@author -->
338343

339344

340345
#### Use case: UC02 - List all undone tasks
@@ -344,6 +349,7 @@ Use case resumes at step 2
344349
1. User enters the `list` command
345350
2. TaskManager parses the `list` command
346351
3. TaskManager removes any filters for the task list and updates the GUI to display the entire list of undone tasks<br>
352+
347353
Use case ends
348354

349355
**Extensions**
@@ -357,7 +363,7 @@ Use case ends
357363

358364
> Use case ends
359365
360-
366+
<!-- @@author A0139552B -->
361367
#### Use case: UC03 - Edit an undone task
362368

363369
**MSS**
@@ -367,7 +373,8 @@ Use case ends
367373
3. User enters the `edit` command, specifying the `INDEX` of the task in the list to be edited, the fields to be edited and their new values
368374
4. TaskManager parses the `edit` command and looks for the task in the list
369375
5. TaskManager edits the requested fields on the specified task according to the command entered
370-
6. TaskManager updates the GUI to display the new list of undone tasks<br>
376+
6. TaskManager updates the GUI to display the new list of undone tasks and highlight the newly edited task <br>
377+
371378
Use case ends
372379

373380
**Extensions**
@@ -391,6 +398,7 @@ Use case ends
391398
>4b1. TaskManager displays an error message on the GUI, informing the user of the correct format for the `edit` command and an example `edit` command <br>
392399
Use case resumes at step 3
393400

401+
<!-- @@author -->
394402

395403
#### Use case: UC04 - Delete an undone task
396404

@@ -462,4 +470,5 @@ Todo.txt | <ol> <li> Works on many platforms, can be accessed on devices that su
462470
Google Calendar | <ol> <li> Can be synced to mobile devices </li> <li> Alerts via notifications on phones </li> <li> Switches between views easily </li> <li> Minimalistic interface </li> </ol> | <ol> <li> Requires an Internet connection to be used </li> <li> Cannot be brought up with a keyboard shortcut </li> </ol>
463471
Remember the milk | <ol> <li> Able to support email, text, IM, Twitter, and mobile notifications </li> <li> Able to share lists and tasks with others</li> <li> Synchronises across on all devices </li> <li> Organize with priorities, due dates, repeats, lists, tags </li> <li> Search tasks and notes, and save favorite searches </li> <li> Integrates with Gmail, Google Calendar, Twitter, Evernote, and more </li> </ol> | <ol> <li> Free version lacks features: E.g. splitting into subtasks </li> <li> Lack keyboard shortcuts</li> </ol>
464472

473+
<!-- @@author A0139552B -->
465474
<strong>Summary:</strong> We observed that these products have very good features, but we realise that none of these products have the specific combination of features that caters to our target audience. Therefore, we are incorporating some of the good features such as minimalistic interface and ability to sync with multiple computers while designing DearJim carefully to avoid the pitfalls found in these products, to make a targeted product for our intended audience.

src/test/java/guitests/EditCommandTest.java

Lines changed: 23 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,11 @@ public void edit() throws IllegalValueException {
4848
aliceTask.setPriority(Priority.MEDIUM);
4949
assertTrue(personListPanel.isListMatching(aliceTask));
5050

51-
//test to check reset function
52-
commandBox.runCommand("edit 1 -reset start end repeat");
53-
aliceTask.setStartDate(null);
54-
aliceTask.setEndDate(null);
55-
aliceTask.setRecurrence(null);
56-
assertTrue(personListPanel.isListMatching(aliceTask));
57-
5851
//edit of priority parameter only
5952
commandBox.runCommand("edit 1 -low");
6053
aliceTask.setPriority(Priority.LOW);
6154
assertTrue(personListPanel.isListMatching(aliceTask));
6255

63-
//ensure that reset command will overwrite any previous edit
64-
commandBox.runCommand("edit 1 from 10am -reset start");
65-
aliceTask.setStartDate(DateTime.convertStringToDate("10am"));
66-
aliceTask.setStartDate(null);
67-
assertTrue(personListPanel.isListMatching(aliceTask));
68-
6956
//test to edit only the name
7057
commandBox.runCommand("edit 1 Trying out new things from the list");
7158
aliceTask.setName(new Name("Trying out new things from the list"));
@@ -81,6 +68,29 @@ public void edit() throws IllegalValueException {
8168

8269
}
8370

71+
@Test
72+
public void editCheckReset() throws IllegalValueException{
73+
74+
TestTask[] currentList = td.getTypicalTasks();
75+
assertClearCommandSuccess();
76+
77+
TestTask aliceTask = new TestTask(td.alice);
78+
assertAddSuccess(aliceTask);
79+
80+
//test to check reset function
81+
commandBox.runCommand("edit 1 -reset start end repeat");
82+
aliceTask.setStartDate(null);
83+
aliceTask.setEndDate(null);
84+
aliceTask.setRecurrence(null);
85+
assertTrue(personListPanel.isListMatching(aliceTask));
86+
87+
//ensure that reset command will overwrite any previous edit
88+
commandBox.runCommand("edit 1 from 10am -reset start");
89+
aliceTask.setStartDate(DateTime.convertStringToDate("10am"));
90+
aliceTask.setStartDate(null);
91+
assertTrue(personListPanel.isListMatching(aliceTask));
92+
}
93+
8494
@Test
8595
public void editCheckInvalid(){
8696
TestTask[] currentList = td.getTypicalTasks();
@@ -94,30 +104,6 @@ public void editCheckInvalid(){
94104
assertResultMessage(String.format(MESSAGE_INVALID_COMMAND_FORMAT, EditCommand.MESSAGE_USAGE));
95105

96106
}
97-
/*
98-
@Test
99-
public void editCheckSort() throws IllegalValueException {
100-
TestTask[] currentList = td.getTypicalTasks();
101-
TestTask personToAdd = td.hoon;
102-
assertAddSuccess(personToAdd, currentList);
103-
currentList = TestUtil.addFloatingTasksToList(currentList, personToAdd);
104-
105-
commandBox.runCommand("edit 2 Call Alice from 2pm to 3pm repeat every day -high");
106-
personToAdd.setName(new Name("Call Alice"));
107-
personToAdd.setStartDate(DateTime.convertStringToDate("2pm"));
108-
personToAdd.setEndDate(DateTime.convertStringToDate("3pm"));
109-
try {
110-
personToAdd.setRecurrence(new RecurrenceRate("1", "day"));
111-
} catch (IllegalValueException e) {
112-
assert false : "The test data provided cannot be invalid";
113-
}
114-
personToAdd.setPriority(Priority.HIGH);
115-
//TODO
116-
//update currentList after the edit
117-
assertTrue(personListPanel.isListMatching(currentList));
118-
119-
}
120-
*/
121107

122108
/**
123109
* Runs the add command to add the specified task and confirms the result is correct.

0 commit comments

Comments
 (0)