You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Expected**: No seller is added. Error indicating that the house already existed in the data. <br>
957
957
958
+
[//]: #(@@author zengzihui)
959
+
### Adding a buyer
960
+
961
+
**Prerequisites:**
962
+
- List all persons using the `list` command.
963
+
- There is currently no `person` with the name "James Cook", "Kris Hua". "John Carl 1" exists as a seller in EstateEase.<br>
964
+
965
+
1.**Add buyer**
966
+
1.**Test case** (add a `buyer` named `James Cook`): `addBuyer n/James Cook p/98753432 e/jamescook@example.com budget/550000 type/Hdb`<br>
967
+
**Expected**: A new buyer is added, with name `James Cook`, phone `98753432`, email `jamescook@example.com`, budget `550000`, preferred housing type `Hdb`<br><br>
968
+
969
+
2.**Invalid format**
970
+
1.**Test case** (add a `buyer` without compulsory details): `addBuyer` <br>
971
+
**Expected**: No buyer is added. Error indicating invalid format with constraints shown. <br><br>
972
+
973
+
2.**Test case** (add a `buyer` with an empty field for type): `addBuyer n/Kris Hua p/98765432 e/krishua@example.com budget/99999900` <br>
974
+
**Expected:** No buyer is added. Error indicating invalid command format. <br><br>
975
+
976
+
3.**Invalid (Duplicate)**
977
+
1.**Test case** (Duplicate person -> seller and buyer cannot be same name): `addBuyer n/John Carl 1 p/98765432 e/johncarl1@example.com budget/550000 type/Hdb`
978
+
**Expected**: No buyer is added. Error indicating that the person already existed in the data. <br><br>
979
+
980
+
4.**Invalid Value for certain fields**
981
+
1.**Test case** (add a `buyer` with an invalid `Preferred Housing Type`): `addBuyer n/Neo Ng p/98765432 e/neong@examaple.com budget/99999900 type/HDB` <br>
982
+
**Expected:** No buyer is added. Error indicating HousingType should only be 'Landed', 'Hdb' or 'Condominium'. HousingType is case-sensitive. <br><br>
983
+
984
+
2.**Test case** (add a `buyer` with an invalid `budget`): `addBuyer n/Grace Tan p/98765432 e/gracetan@examaple.com budget/-99999900 type/Hdb` <br>
985
+
**Expected:** No buyer is added. Error indicating budget should be a positive number. <br><br>
986
+
987
+
3.**Test case** (add a `buyer` with an invalid `budget`): `addBuyer n/Chris Ong p/98765432 e/chrisong@examaple.com budget/aa type/Hdb` <br>
988
+
**Expected:** No buyer is added. Error indicating budget should be a positive number. <br><br>
0 commit comments