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

Update UserGuide for auto-sort #79

Merged
merged 7 commits into from
Oct 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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());
}

}