Skip to content

Commit

Permalink
Merge pull request #79 from AY1920S1-CS2103T-F11-2/P-autosort-items
Browse files Browse the repository at this point in the history
Update UserGuide for auto-sort
  • Loading branch information
JermyTan committed Oct 17, 2019
2 parents c0b478a + 98307dc commit 6be9bbc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
15 changes: 9 additions & 6 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,18 @@ Format: `help`


=== Adding an item: `add`

Adds an item to your tracker. +
Upon addition of the item, the updated list sorted by name then date in chronological order, will be displayed. +
Format: `add|<item name>|<expiry date>[|<quantity>]`

Examples:

* `add|durian|30/09/2020` (without quantity) +
Adds the item `durian` with expiry date `30/09/2019` with quantity `1`
* `add|durian|30/9/2020` (without quantity) +
Adds the item `durian` with expiry date `30/9/2019` with quantity `1`

* `add|ice cream|18/8/2020|2` +
Adds the item `ice cream` with expiry date `18/08/2019` with quantity `2`
Adds the item `ice cream` with expiry date `18/8/2019` with quantity `2`

****
* Item quantity **must be a positive integer** 1,2,3...
Expand All @@ -89,7 +91,8 @@ For items with single quantity, you can save time by keying in only the item nam

=== Listing all items : `view`

Lists all items in your tracker. +
Shows all items in the list. +
All items are sorted by both name (lexicographical order) and date (chronological order). +
Format: `view`

=== Setting reminder for an item: `set reminder`
Expand Down Expand Up @@ -141,8 +144,8 @@ Sorts all items in your list by either name or date. +
Format: `sort|<key>`

****
* Sorting by both name and date is done in ascending order.
* For example, Apple will sort ahead of Banana, while 01/01/2000 will sort ahead of 01/01/2001.
* Items are sorted by both name and date.
* For example, Apple will sort ahead of Banana, while 1/1/2000 will sort ahead of 1/1/2001.
****

Examples:
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/io/xpire/logic/commands/SortCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
public class SortCommandTest {

private Model model;
private Model expectedModel;

@BeforeEach
public void setUp() {
model = new ModelManager(getTypicalExpiryDateTracker(), new UserPrefs());
expectedModel = new ModelManager(model.getXpire(), new UserPrefs());
}

}

0 comments on commit 6be9bbc

Please sign in to comment.