forked from nus-cs2103-AY1819S1/addressbook-level1
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate phone numbers starting with + as valid
- Loading branch information
Showing
3 changed files
with
37 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|| =================================================== | ||
|| =================================================== | ||
|| AddessBook Level 1 - Version 1.0 | ||
|| AddressBook Level 1 - Version 1.0 | ||
|| Welcome to your Address Book! | ||
|| =================================================== | ||
|| The given file name [ ] is not a valid file name! | ||
|
@@ -9,7 +9,7 @@ | |
|| =================================================== | ||
|| =================================================== | ||
|| =================================================== | ||
|| AddessBook Level 1 - Version 1.0 | ||
|| AddressBook Level 1 - Version 1.0 | ||
|| Welcome to your Address Book! | ||
|| =================================================== | ||
|| The given file name [directoryThatDoesNotExist/valid.filename] is not a valid file name! | ||
|
@@ -18,7 +18,7 @@ | |
|| =================================================== | ||
|| =================================================== | ||
|| =================================================== | ||
|| AddessBook Level 1 - Version 1.0 | ||
|| AddressBook Level 1 - Version 1.0 | ||
|| Welcome to your Address Book! | ||
|| =================================================== | ||
|| The given file name [.noFilename] is not a valid file name! | ||
|
@@ -27,7 +27,7 @@ | |
|| =================================================== | ||
|| =================================================== | ||
|| =================================================== | ||
|| AddessBook Level 1 - Version 1.0 | ||
|| AddressBook Level 1 - Version 1.0 | ||
|| Welcome to your Address Book! | ||
|| =================================================== | ||
|| The given file name [data/notRegularFile.txt] is not a valid file name! | ||
|
@@ -36,7 +36,7 @@ | |
|| =================================================== | ||
|| =================================================== | ||
|| =================================================== | ||
|| AddessBook Level 1 - Version 1.0 | ||
|| AddressBook Level 1 - Version 1.0 | ||
|| Welcome to your Address Book! | ||
|| =================================================== | ||
|| Enter command: || [Command entered:exit] | ||
|
@@ -45,7 +45,7 @@ | |
|| =================================================== | ||
|| =================================================== | ||
|| =================================================== | ||
|| AddessBook Level 1 - Version 1.0 | ||
|| AddressBook Level 1 - Version 1.0 | ||
|| Welcome to your Address Book! | ||
|| =================================================== | ||
|| Using default storage file : addressbook.txt | ||
|
@@ -121,6 +121,13 @@ | |
|| Example: add John Doe p/98765432 e/[email protected] | ||
|| | ||
|| =================================================== | ||
|| Enter command: || [Command entered: add Valid Name p/1+2345 e/[email protected]] | ||
|| Invalid command format: add | ||
|| add: Adds a person to the address book. | ||
|| Parameters: NAME p/PHONE_NUMBER e/EMAIL | ||
|| Example: add John Doe p/98765432 e/[email protected] | ||
|| | ||
|| =================================================== | ||
|| Enter command: || [Command entered: add Adam Brown p/111111 e/[email protected]] | ||
|| New person added: Adam Brown, Phone: 111111, Email: [email protected] | ||
|| =================================================== | ||
|
@@ -129,12 +136,12 @@ | |
|| | ||
|| 1 persons found! | ||
|| =================================================== | ||
|| Enter command: || [Command entered: add Betsy Choo p/222222 e/[email protected]] | ||
|| New person added: Betsy Choo, Phone: 222222, Email: [email protected] | ||
|| Enter command: || [Command entered: add Betsy Choo p/+222222 e/[email protected]] | ||
|| New person added: Betsy Choo, Phone: +222222, Email: [email protected] | ||
|| =================================================== | ||
|| Enter command: || [Command entered: list] | ||
|| 1. Adam Brown Phone Number: 111111 Email: [email protected] | ||
|| 2. Betsy Choo Phone Number: 222222 Email: [email protected] | ||
|| 2. Betsy Choo Phone Number: +222222 Email: [email protected] | ||
|| | ||
|| 2 persons found! | ||
|| =================================================== | ||
|
@@ -143,19 +150,19 @@ | |
|| =================================================== | ||
|| Enter command: || [Command entered: list] | ||
|| 1. Adam Brown Phone Number: 111111 Email: [email protected] | ||
|| 2. Betsy Choo Phone Number: 222222 Email: [email protected] | ||
|| 2. Betsy Choo Phone Number: +222222 Email: [email protected] | ||
|| 3. Charlie Dickson Phone Number: 333333 Email: [email protected] | ||
|| | ||
|| 3 persons found! | ||
|| =================================================== | ||
|| Enter command: || [Command entered: add Dickson Ee e/[email protected] p/444444] | ||
|| New person added: Dickson Ee, Phone: 444444, Email: [email protected] | ||
|| Enter command: || [Command entered: add Dickson Ee e/[email protected] p/+444444] | ||
|| New person added: Dickson Ee, Phone: +444444, Email: [email protected] | ||
|| =================================================== | ||
|| Enter command: || [Command entered: list] | ||
|| 1. Adam Brown Phone Number: 111111 Email: [email protected] | ||
|| 2. Betsy Choo Phone Number: 222222 Email: [email protected] | ||
|| 2. Betsy Choo Phone Number: +222222 Email: [email protected] | ||
|| 3. Charlie Dickson Phone Number: 333333 Email: [email protected] | ||
|| 4. Dickson Ee Phone Number: 444444 Email: [email protected] | ||
|| 4. Dickson Ee Phone Number: +444444 Email: [email protected] | ||
|| | ||
|| 4 persons found! | ||
|| =================================================== | ||
|
@@ -164,9 +171,9 @@ | |
|| =================================================== | ||
|| Enter command: || [Command entered: list] | ||
|| 1. Adam Brown Phone Number: 111111 Email: [email protected] | ||
|| 2. Betsy Choo Phone Number: 222222 Email: [email protected] | ||
|| 2. Betsy Choo Phone Number: +222222 Email: [email protected] | ||
|| 3. Charlie Dickson Phone Number: 333333 Email: [email protected] | ||
|| 4. Dickson Ee Phone Number: 444444 Email: [email protected] | ||
|| 4. Dickson Ee Phone Number: +444444 Email: [email protected] | ||
|| 5. Esther Potato Phone Number: 555555 Email: [email protected] | ||
|| | ||
|| 5 persons found! | ||
|
@@ -188,18 +195,18 @@ | |
|| 0 persons found! | ||
|| =================================================== | ||
|| Enter command: || [Command entered: find Betsy] | ||
|| 1. Betsy Choo Phone Number: 222222 Email: [email protected] | ||
|| 1. Betsy Choo Phone Number: +222222 Email: [email protected] | ||
|| | ||
|| 1 persons found! | ||
|| =================================================== | ||
|| Enter command: || [Command entered: find Dickson] | ||
|| 1. Charlie Dickson Phone Number: 333333 Email: [email protected] | ||
|| 2. Dickson Ee Phone Number: 444444 Email: [email protected] | ||
|| 2. Dickson Ee Phone Number: +444444 Email: [email protected] | ||
|| | ||
|| 2 persons found! | ||
|| =================================================== | ||
|| Enter command: || [Command entered: find Charlie Betsy] | ||
|| 1. Betsy Choo Phone Number: 222222 Email: [email protected] | ||
|| 1. Betsy Choo Phone Number: +222222 Email: [email protected] | ||
|| 2. Charlie Dickson Phone Number: 333333 Email: [email protected] | ||
|| | ||
|| 2 persons found! | ||
|
@@ -243,8 +250,8 @@ | |
|| =================================================== | ||
|| Enter command: || [Command entered: list] | ||
|| 1. Adam Brown Phone Number: 111111 Email: [email protected] | ||
|| 2. Betsy Choo Phone Number: 222222 Email: [email protected] | ||
|| 3. Dickson Ee Phone Number: 444444 Email: [email protected] | ||
|| 2. Betsy Choo Phone Number: +222222 Email: [email protected] | ||
|| 3. Dickson Ee Phone Number: +444444 Email: [email protected] | ||
|| 4. Esther Potato Phone Number: 555555 Email: [email protected] | ||
|| | ||
|| 4 persons found! | ||
|
@@ -254,17 +261,17 @@ | |
|| =================================================== | ||
|| Enter command: || [Command entered: list] | ||
|| 1. Adam Brown Phone Number: 111111 Email: [email protected] | ||
|| 2. Betsy Choo Phone Number: 222222 Email: [email protected] | ||
|| 3. Dickson Ee Phone Number: 444444 Email: [email protected] | ||
|| 2. Betsy Choo Phone Number: +222222 Email: [email protected] | ||
|| 3. Dickson Ee Phone Number: +444444 Email: [email protected] | ||
|| | ||
|| 3 persons found! | ||
|| =================================================== | ||
|| Enter command: || [Command entered: delete 1] | ||
|| Deleted Person: Adam Brown Phone Number: 111111 Email: [email protected] | ||
|| =================================================== | ||
|| Enter command: || [Command entered: list] | ||
|| 1. Betsy Choo Phone Number: 222222 Email: [email protected] | ||
|| 2. Dickson Ee Phone Number: 444444 Email: [email protected] | ||
|| 1. Betsy Choo Phone Number: +222222 Email: [email protected] | ||
|| 2. Dickson Ee Phone Number: +444444 Email: [email protected] | ||
|| | ||
|| 2 persons found! | ||
|| =================================================== | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
list | ||
|
||
########################################################## | ||
# test add person command, setup state for futuer tests | ||
# test add person command, setup state for future tests | ||
########################################################## | ||
|
||
# should catch invalid args format | ||
|
@@ -26,17 +26,18 @@ | |
add []\[;] p/12345 e/[email protected] | ||
add Valid Name p/not_numbers e/[email protected] | ||
add Valid Name p/12345 e/notAnEmail | ||
add Valid Name p/1+2345 e/[email protected] | ||
|
||
# should add correctly | ||
add Adam Brown p/111111 e/[email protected] | ||
list | ||
add Betsy Choo p/222222 e/[email protected] | ||
add Betsy Choo p/+222222 e/[email protected] | ||
list | ||
|
||
# order of phone and email should not matter | ||
add Charlie Dickson e/[email protected] p/333333 | ||
list | ||
add Dickson Ee e/[email protected] p/444444 | ||
add Dickson Ee e/[email protected] p/+444444 | ||
list | ||
add Esther Potato p/555555 e/[email protected] | ||
list | ||
|