Skip to content

Commit 2c72f16

Browse files
committed
Add expected outcomes
1 parent 853c78a commit 2c72f16

File tree

1 file changed

+147
-12
lines changed

1 file changed

+147
-12
lines changed

docs/UserGuide.md

Lines changed: 147 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,28 @@ Format: `add-book BOOK_TITLE a/AUTHOR cat/CATEGORY cond/CONDITION loc/LOCATION [
6060
Example:
6161

6262
```
63-
add-book The Great Gatsby a/F. Scott Fitzgerald cat/Fiction cond/Good loc/Shelf B1
63+
add-book Great Gatsby a/Fitzgerald cat/Fiction cond/Good loc/Shelf B1
6464
```
6565

6666
or
6767

6868
```
69-
add-book The Great Gatsby a/F. Scott Fitzgerald cat/Fiction cond/Good loc/Shelf B1 note/important
69+
add-book Great Gatsby a/Fitzgerald cat/Fiction cond/Good loc/Shelf B1 note/important
7070
```
7171

72+
Expected Outcome:
73+
74+
```
75+
New book added: Great Gatsby
76+
```
77+
78+
#### Adding a Title that already exists in inventory
79+
80+
BookKeeper does not support multiple copies of books with the same title. If the the user attempts to add a duplicate title, the system will not permit the addition. You will see an error message indicating that the book already exists.
81+
82+
Example:
83+
`Book already exists in inventory: Great Gatsby`
84+
7285
### Removing a book: `remove-book`
7386

7487
Removes a book from the library collection.
@@ -78,7 +91,13 @@ Format: `remove-book BOOK_TITLE`
7891
Example:
7992

8093
```
81-
remove-book The Great Gatsby
94+
remove-book Great Gatsby
95+
```
96+
97+
Expected Outcome:
98+
99+
```
100+
Removed book: Great Gatsby
82101
```
83102

84103
### Updating a Book: `update-book`
@@ -90,7 +109,20 @@ Format: `update-book BOOK_TITLE a/AUTHOR cat/CATEGORY cond/CONDITION loc/LOCATIO
90109
Example:
91110

92111
```
93-
update-book The Great Gatsby a/F. Scott Fitzgerald cat/Fiction cond/POOR loc/Shelf B3 note/Replace ASAP
112+
update-book Great Gatsby a/Fitzgerald cat/Fiction cond/POOR loc/Shelf B3 note/Replace ASAP
113+
```
114+
115+
Expected Outcome:
116+
117+
```
118+
Book Updated:
119+
Title: Great Gatsby
120+
Author: Fitzgerald
121+
Category: Fiction
122+
Condition: POOR
123+
On Loan: false
124+
Location: Shelf B3
125+
Note: Replace ASAP
94126
```
95127

96128
### Searching for a Book: `search-book`
@@ -105,6 +137,21 @@ Example:
105137
search-book Great
106138
```
107139

140+
Expected Outcome:
141+
142+
```
143+
Here are the books in your inventory:
144+
1. Title: Great Gatsby
145+
Author: Fitzgerald
146+
Category: Fiction
147+
Condition: GOOD
148+
On Loan: false
149+
Location: Shelf B1
150+
Note: No notes available
151+
2.
152+
...
153+
```
154+
108155
### View Book Collection: `view-inventory`
109156

110157
View all books currently in the collection.
@@ -117,6 +164,24 @@ Example:
117164
view-inventory
118165
```
119166

167+
Expected Outcome:
168+
169+
```
170+
Here are the books in your inventory:
171+
1. Title: Great Gatsby
172+
Author: Fitzgerald
173+
Category: Fiction
174+
Condition: GOOD
175+
On Loan: false
176+
Location: Shelf B1
177+
Note: No notes available
178+
179+
2. Title: Cheese Chronicles
180+
Author: Jerry
181+
Category: Fiction
182+
...
183+
```
184+
120185
### Adding a Note: `add-note`
121186

122187
Add a personal note to a book.
@@ -126,7 +191,13 @@ Format: `add-note BOOK_TITLE note/NOTE`
126191
Example:
127192

128193
```
129-
add-note The Great Gatsby note/Very good book
194+
add-note Great Gatsby note/Very good book
195+
```
196+
197+
Expected Outcome:
198+
199+
```
200+
Note added to book: Great Gatsby
130201
```
131202

132203
### Deleting a Note: `delete-note`
@@ -138,7 +209,13 @@ Format: `delete-note BOOK_TITLE`
138209
Example:
139210

140211
```
141-
delete-note The Great Gatsby
212+
delete-note Great Gatsby
213+
```
214+
215+
Expected Outcome:
216+
217+
```
218+
Note deleted for book: Great Gatsby
142219
```
143220

144221
### List Category: `list-category`
@@ -153,6 +230,19 @@ Example:
153230
list-category Fiction
154231
```
155232

233+
Expected Outcome:
234+
235+
```
236+
Here are the books in your inventory:
237+
1. Title: Great Gatsby
238+
Author: Fitzgerald
239+
Category: Fiction
240+
Condition: GOOD
241+
On Loan: false
242+
Location: Shelf B1
243+
Note: No notes available
244+
```
245+
156246
### Adding a Loan: `add-loan`
157247

158248
Adds a loan using the book title.
@@ -162,15 +252,21 @@ Format: `add-loan BOOK_TITLE n/BORROWER_NAME d/RETURN_DATE p/PHONE_NUMBER e/EMAI
162252
Example:
163253

164254
```
165-
add-loan The Great Gatsby n/John Doe d/2023-12-01 p/98765432 e/abc123@gmail.com
255+
add-loan Great Gatsby n/John Doe d/2023-12-01 p/98765432 e/abc123@gmail.com
256+
```
257+
258+
Expected Output:
259+
260+
```
261+
Loan added successfully for book: Great Gatsby
166262
```
167263

168264
#### Adding a Loan for a Book Already on Loan
169265

170266
If the book is already on loan, the system will not allow adding another loan for the same book. You will see an error message indicating that the book is unavailable.
171267

172268
Example:
173-
`Error: The book "The Great Gatsby" is already on loan.`
269+
`Error: The book "Great Gatsby" is already on loan.`
174270

175271
### Deleting a Loan: `delete-loan`
176272

@@ -181,7 +277,13 @@ Format: `delete-loan BOOK_TITLE n/BORROWER_NAME`
181277
Example:
182278

183279
```
184-
delete-loan The Great Gatsby n/John Doe
280+
delete-loan Great Gatsby n/John Doe
281+
```
282+
283+
Expected Outcome:
284+
285+
```
286+
Loan deleted successfully for book: Great Gatsby
185287
```
186288

187289
### Editing a Loan: `edit-loan`
@@ -193,7 +295,18 @@ Format: `edit-loan BOOK_TITLE n/BORROWER_NAME d/RETURN_DATE p/PHONE_NUMBER e/EMA
193295
Example:
194296

195297
```
196-
edit-loan The Great Gatsby n/Mary d/15-March-2025 p/91234567 e/123abc@gmail.com
298+
edit-loan Great Gatsby n/John Doe d/15-March-2025 p/91234567 e/123abc@gmail.com
299+
```
300+
301+
Expected Outcome:
302+
303+
```
304+
Loan Updated:
305+
Title: Great Gatsby
306+
Borrower: John Doe
307+
Return Date: 15-March-2025
308+
Contact Number: 91234567
309+
Email: 123abc@gmail.com
197310
```
198311

199312
### View Current Loans: `view-loans`
@@ -208,6 +321,22 @@ Example:
208321
view-loans
209322
```
210323

324+
Expected Outcome:
325+
326+
```
327+
Here are the active loans:
328+
1. Title: Great Gatsby
329+
Borrower: John Doe
330+
Return Date: 2023-12-01
331+
Contact Number: 98765432
332+
Email: abc123@gmail.com
333+
334+
2. Title: Cheese Chronicles
335+
Borrower: Gerald
336+
Return Date: 2043-11-04
337+
...
338+
```
339+
211340
### Displaying Help: `help`
212341

213342
Displays a list of all available commands and their formats.
@@ -232,6 +361,12 @@ Example:
232361
exit
233362
```
234363

364+
Expected Outcome:
365+
366+
```
367+
Exiting BookKeeper...
368+
```
369+
235370
<div style="page-break-after: always;"></div>
236371

237372
## Persistent State
@@ -254,11 +389,11 @@ BookKeeper validates data when loading from files. If invalid data is encountere
254389
Example:
255390
Invalid Entry in Inventory File:
256391

257-
`The Great Gatsby | F. Scott Fitzgerald | Fiction`
392+
`The Great Gatsby | Fitzgerald | Fiction`
258393

259394
Warning Message:
260395

261-
`Invalid book entry skipped: The Great Gatsby | F. Scott Fitzgerald | Fiction`
396+
`Invalid book entry skipped: The Great Gatsby | Fitzgerald | Fiction`
262397

263398
### Notes:
264399

0 commit comments

Comments
 (0)