forked from AY2324S2-CS2103T-F12-1/tp
-
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.
Merge branch 'master' into Fix-bug-175
- Loading branch information
Showing
16 changed files
with
123 additions
and
82 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
{ | ||
"id": 1, | ||
"name": "Valid Client", | ||
"phone": "9482424", | ||
"phone": "94824241", | ||
"email": "[email protected]", | ||
"address": "123 Client St", | ||
"role": "client", | ||
|
@@ -15,7 +15,7 @@ | |
{ | ||
"id": 2, | ||
"name": "Valid Supplier", | ||
"phone": "1111111", | ||
"phone": "11111111", | ||
"email": "[email protected]", | ||
"address": "1 Supplier Ave", | ||
"role": "supplier", | ||
|
@@ -29,7 +29,7 @@ | |
{ | ||
"id": 3, | ||
"name": "Valid Employee", | ||
"phone": "2222222", | ||
"phone": "22222222", | ||
"email": "[email protected]", | ||
"address": "2 Employee Blvd", | ||
"role": "employee", | ||
|
@@ -46,7 +46,7 @@ | |
{ | ||
"id": 4, | ||
"name": "Person With Invalid Phone Field", | ||
"phone": "948asdf2424", | ||
"phone": "948asd24", | ||
"email": "[email protected]", | ||
"address": "4th street", | ||
"role": "client", | ||
|
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 |
---|---|---|
|
@@ -52,7 +52,7 @@ | |
{ | ||
"id": 4, | ||
"name": "Elle Meyer", | ||
"phone": "9482224", | ||
"phone": "94822241", | ||
"email": "[email protected]", | ||
"address": "michegan ave", | ||
"tags": [], | ||
|
@@ -68,7 +68,7 @@ | |
{ | ||
"id": 5, | ||
"name": "Fiona Kunz", | ||
"phone": "9482427", | ||
"phone": "94824271", | ||
"email": "[email protected]", | ||
"address": "little tokyo", | ||
"tags": [], | ||
|
@@ -84,7 +84,7 @@ | |
{ | ||
"id": 6, | ||
"name": "George Best", | ||
"phone": "9482442", | ||
"phone": "94824421", | ||
"email": "[email protected]", | ||
"address": "4th street", | ||
"tags": [], | ||
|
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 |
---|---|---|
|
@@ -38,7 +38,7 @@ public class ParserUtilTest { | |
private static final String INVALID_SKILLS = "Invalid Skills!@#"; | ||
|
||
private static final String VALID_NAME = "Rachel Walker"; | ||
private static final String VALID_PHONE = "123456"; | ||
private static final String VALID_PHONE = "12345678"; | ||
private static final String VALID_ADDRESS = "123 Main Street #0505"; | ||
private static final String VALID_EMAIL = "[email protected]"; | ||
private static final String VALID_TAG_1 = "friend"; | ||
|
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 |
---|---|---|
|
@@ -44,14 +44,14 @@ public void setUp() { | |
@Test | ||
public void createDataList_correctlyConstructedList() { | ||
List<Person> persons = Arrays.asList( | ||
new EmployeeBuilder().withId(1).withName("John Doe").withPhone("1234567890") | ||
new EmployeeBuilder().withId(1).withName("John Doe").withPhone("12345678") | ||
.withEmail("[email protected]").withAddress("123 Main St").withDepartment("HR") | ||
.withJobTitle("Manager").withSkills("Java, SQL").build(), | ||
new ClientBuilder().withId(2).withName("Jane Smith").withPhone("9876543210") | ||
new ClientBuilder().withId(2).withName("Jane Smith").withPhone("98765432") | ||
.withEmail("[email protected]") | ||
.withAddress("456 Elm St").withProducts("Product A").withPreferences("Likes discounts") | ||
.build(), | ||
new SupplierBuilder().withId(3).withName("Acme Inc").withPhone("5555555555").withEmail("[email protected]") | ||
new SupplierBuilder().withId(3).withName("Acme Inc").withPhone("55555555").withEmail("[email protected]") | ||
.withAddress("789 Oak St").withProducts("Product X").withTermsOfService("30 days").build() | ||
); | ||
FilteredList<Person> filteredList = new FilteredList<>(FXCollections.observableArrayList(persons)); | ||
|
@@ -65,11 +65,11 @@ public void createDataList_correctlyConstructedList() { | |
assertArrayEquals(new String[]{"ID", "Name", "Phone", "Email", "Address", "Remark", "Tags", "Department", | ||
"Job Title", "Skills", "Products", "Preferences", "Terms of Service"}, dataList.get(0)); | ||
|
||
assertArrayEquals(new String[]{"1", "John Doe", "1234567890", "[email protected]", "\"123 Main St\"", | ||
assertArrayEquals(new String[]{"1", "John Doe", "12345678", "[email protected]", "\"123 Main St\"", | ||
"some remarks", "", "HR", "Manager", "Java, SQL", "", "", ""}, dataList.get(1)); | ||
assertArrayEquals(new String[]{"2", "Jane Smith", "9876543210", "[email protected]", "\"456 Elm St\"", | ||
assertArrayEquals(new String[]{"2", "Jane Smith", "98765432", "[email protected]", "\"456 Elm St\"", | ||
"some remarks", "", "", "", "", "Product A", "Likes discounts", ""}, dataList.get(2)); | ||
assertArrayEquals(new String[]{"3", "Acme Inc", "5555555555", "[email protected]", "\"789 Oak St\"", | ||
assertArrayEquals(new String[]{"3", "Acme Inc", "55555555", "[email protected]", "\"789 Oak St\"", | ||
"some remarks", "", "", "", "", "Product X", "", "30 days"}, dataList.get(3)); | ||
} | ||
|
||
|
@@ -145,7 +145,7 @@ public void convertPersonToStringArray_client() { | |
@Test | ||
public void convertPersonToStringArray_supplier() { | ||
String[] expectedArray = new String[]{ | ||
"5", "Fiona Kunz", "9482427", "[email protected]", "\"little tokyo\"", "some remarks", "", "", "", | ||
"5", "Fiona Kunz", "94824271", "[email protected]", "\"little tokyo\"", "some remarks", "", "", "", | ||
"", "Office Supplies, Furniture", "", "Delivery within 2 weeks" | ||
}; | ||
assertArrayEquals(expectedArray, csvExporter.convertPersonToStringArray(TypicalPersons.FIONA)); | ||
|
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 |
---|---|---|
|
@@ -87,8 +87,8 @@ public void test_nameDoesNotContainKeywords_returnsFalse() { | |
assertFalse(predicate.test(new EmployeeBuilder().withName("Alice Bob").build())); | ||
|
||
// Keywords match phone, email, and address, but does not match name | ||
predicate = new NameContainsKeywordsPredicate(Arrays.asList("12345", "[email protected]", "Main", "Street")); | ||
assertFalse(predicate.test(new ClientBuilder().withName("Alice").withPhone("12345") | ||
predicate = new NameContainsKeywordsPredicate(Arrays.asList("12345678", "[email protected]", "Main", "Street")); | ||
assertFalse(predicate.test(new ClientBuilder().withName("Alice").withPhone("12345678") | ||
.withEmail("[email protected]").withAddress("Main Street").build())); | ||
} | ||
|
||
|
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 |
---|---|---|
|
@@ -75,7 +75,7 @@ public void test_phoneDoesNotMatchDigits_returnsFalse() { | |
|
||
// Keywords match name, email and address, but does not match phone | ||
predicate = new PhoneMatchesDigitsPredicate(Arrays.asList("Alice", "[email protected]", "Main", "Street")); | ||
assertFalse(predicate.test(new ClientBuilder().withName("Alice").withPhone("12345") | ||
assertFalse(predicate.test(new ClientBuilder().withName("Alice").withPhone("12345678") | ||
.withEmail("[email protected]").withAddress("Main Street").build())); | ||
} | ||
|
||
|
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 |
---|---|---|
|
@@ -134,7 +134,7 @@ public void test_remarkDoesNotContainKeywords_returnsFalse() { | |
// Keywords match name, phone, email and address, but does not match remark | ||
predicate = new RemarkContainsKeywordsPredicate( | ||
Arrays.asList("Alice", "[email protected]", "Main", "Street", "12345")); | ||
assertFalse(predicate.test(new SupplierBuilder().withName("Alice").withPhone("12345") | ||
assertFalse(predicate.test(new SupplierBuilder().withName("Alice").withPhone("12345678") | ||
.withEmail("[email protected]").withAddress("Main Street").withRemark("biscuit").build())); | ||
|
||
// Non-empty remark with empty keyword | ||
|
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 |
---|---|---|
|
@@ -73,8 +73,8 @@ public void test_tagsDoesNotContainKeywords_returnsFalse() { | |
|
||
// Keywords match name, phone, email, and address, but does not match tags | ||
predicate = new TagsContainsKeywordsPredicate( | ||
Arrays.asList("Alice", "12345", "[email protected]", "Main", "Street")); | ||
assertFalse(predicate.test(new ClientBuilder().withName("Alice").withPhone("12345") | ||
Arrays.asList("Alice", "12345678", "[email protected]", "Main", "Street")); | ||
assertFalse(predicate.test(new ClientBuilder().withName("Alice").withPhone("12345678") | ||
.withEmail("[email protected]").withAddress("Main Street").withTags("friends").build())); | ||
} | ||
|
||
|
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 |
---|---|---|
|
@@ -54,24 +54,24 @@ public class TypicalPersons { | |
.withSkills("Public Speaking", "Digital Marketing").build(); | ||
|
||
public static final Employee ELLE = new EmployeeBuilder().withId(4).withName("Elle Meyer") | ||
.withPhone("9482224").withEmail("[email protected]").withAddress("michegan ave") | ||
.withPhone("94822241").withEmail("[email protected]").withAddress("michegan ave") | ||
.withDepartment("IT").withJobTitle("Developer").withSkills("Java", "C++").build(); | ||
|
||
public static final Supplier FIONA = new SupplierBuilder().withId(5).withName("Fiona Kunz") | ||
.withPhone("9482427").withEmail("[email protected]").withAddress("little tokyo") | ||
.withPhone("94824271").withEmail("[email protected]").withAddress("little tokyo") | ||
.withProducts("Office Supplies", "Furniture").withTermsOfService("Delivery within 2 weeks").build(); | ||
|
||
public static final Supplier GEORGE = new SupplierBuilder().withId(6).withName("George Best") | ||
.withPhone("9482442").withEmail("[email protected]").withAddress("4th street") | ||
.withPhone("94824421").withEmail("[email protected]").withAddress("4th street") | ||
.withProducts("Electronics", "Gadgets").withTermsOfService("Warranty for 1 year").build(); | ||
|
||
// Manually added | ||
public static final Employee HOON = new EmployeeBuilder().withId(9).withName("Hoon Meier").withPhone("8482424") | ||
public static final Employee HOON = new EmployeeBuilder().withId(9).withName("Hoon Meier").withPhone("84824241") | ||
.withEmail("[email protected]").withAddress("little india") | ||
.withDepartment("Tech Support").withJobTitle("Technician") | ||
.withSkills("Technical Support", "Customer Service").build(); | ||
|
||
public static final Supplier IDA = new SupplierBuilder().withId(10).withName("Ida Mueller").withPhone("8482131") | ||
public static final Supplier IDA = new SupplierBuilder().withId(10).withName("Ida Mueller").withPhone("84821311") | ||
.withEmail("[email protected]").withAddress("chicago ave") | ||
.withProducts("Computer Hardware", "Printers").withTermsOfService("Returns within 30 days").build(); | ||
|
||
|
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 |
---|---|---|
|
@@ -2,5 +2,5 @@ ID,Name,Phone,Email,Address,Remark,Tags,Department,Job Title,Skills,Products,Pre | |
1,Alice Pauline,94351253,[email protected],"123, Jurong West Ave 6, #08-111",some remarks,"friends",,,,Product1, Product2,Vegan, | ||
2,Benson Meier,98765432,[email protected],"311, Clementi Ave 2, #02-25",some remarks,"owesMoney, friends",,,,Product3,Gluten-Free, | ||
3,Daniel Meier,87652533,[email protected],"10th street",some remarks,"friends",Marketing,Manager,Digital Marketing, Public Speaking,,, | ||
4,Elle Meyer,9482224,[email protected],"michegan ave",some remarks,,IT,Developer,Java, C++,,, | ||
5,Fiona Kunz,9482427,[email protected],"little tokyo",some remarks,,,,,Office Supplies, Furniture,,Delivery within 2 weeks | ||
4,Elle Meyer,94822241,[email protected],"michegan ave",some remarks,,IT,Developer,Java, C++,,, | ||
5,Fiona Kunz,94824271,[email protected],"little tokyo",some remarks,,,,,Office Supplies, Furniture,,Delivery within 2 weeks |