Skip to content

Commit

Permalink
Merge pull request #231 from FerdiHS/remove-customer-address
Browse files Browse the repository at this point in the history
Remove Address in Customer since it is not used
  • Loading branch information
FerdiHS authored Nov 12, 2023
2 parents 6c44a1b + 47f549d commit d8fd140
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 173 deletions.
16 changes: 0 additions & 16 deletions src/main/java/seedu/address/logic/parser/ParserUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import seedu.address.commons.core.index.Index;
import seedu.address.commons.util.StringUtil;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.customer.Address;
import seedu.address.model.customer.Budget;
import seedu.address.model.customer.Email;
import seedu.address.model.customer.Name;
Expand Down Expand Up @@ -71,21 +70,6 @@ public static Phone parsePhone(String phone) throws ParseException {
return new Phone(trimmedPhone);
}

/**
* Parses a {@code String address} into an {@code Address}.
* Leading and trailing whitespaces will be trimmed.
*
* @throws ParseException if the given {@code address} is invalid.
*/
public static Address parseAddress(String address) throws ParseException {
requireNonNull(address);
String trimmedAddress = address.trim();
if (!Address.isValidAddress(trimmedAddress)) {
throw new ParseException(Address.MESSAGE_CONSTRAINTS);
}
return new Address(trimmedAddress);
}

/**
* Parses a {@code String email} into an {@code Email}.
* Leading and trailing whitespaces will be trimmed.
Expand Down
65 changes: 0 additions & 65 deletions src/main/java/seedu/address/model/customer/Address.java

This file was deleted.

26 changes: 0 additions & 26 deletions src/test/java/seedu/address/logic/parser/ParserUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.junit.jupiter.api.Test;

import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.customer.Address;
import seedu.address.model.customer.Email;
import seedu.address.model.customer.Name;
import seedu.address.model.customer.Phone;
Expand All @@ -23,13 +22,11 @@
public class ParserUtilTest {
private static final String INVALID_NAME = "R@chel";
private static final String INVALID_PHONE = "+651234";
private static final String INVALID_ADDRESS = " ";
private static final String INVALID_EMAIL = "example.com";
private static final String INVALID_TAG = "#friend";

private static final String VALID_NAME = "Rachel Walker";
private static final String VALID_PHONE = "90123456";
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";
private static final String VALID_TAG_2 = "neighbour";
Expand Down Expand Up @@ -102,29 +99,6 @@ public void parsePhone_validValueWithWhitespace_returnsTrimmedPhone() throws Exc
assertEquals(expectedPhone, ParserUtil.parsePhone(phoneWithWhitespace));
}

@Test
public void parseAddress_null_throwsNullPointerException() {
assertThrows(NullPointerException.class, () -> ParserUtil.parseAddress((String) null));
}

@Test
public void parseAddress_invalidValue_throwsParseException() {
assertThrows(ParseException.class, () -> ParserUtil.parseAddress(INVALID_ADDRESS));
}

@Test
public void parseAddress_validValueWithoutWhitespace_returnsAddress() throws Exception {
Address expectedAddress = new Address(VALID_ADDRESS);
assertEquals(expectedAddress, ParserUtil.parseAddress(VALID_ADDRESS));
}

@Test
public void parseAddress_validValueWithWhitespace_returnsTrimmedAddress() throws Exception {
String addressWithWhitespace = WHITESPACE + VALID_ADDRESS + WHITESPACE;
Address expectedAddress = new Address(VALID_ADDRESS);
assertEquals(expectedAddress, ParserUtil.parseAddress(addressWithWhitespace));
}

@Test
public void parseEmail_null_throwsNullPointerException() {
assertThrows(NullPointerException.class, () -> ParserUtil.parseEmail((String) null));
Expand Down
66 changes: 0 additions & 66 deletions src/test/java/seedu/address/model/customer/AddressTest.java

This file was deleted.

0 comments on commit d8fd140

Please sign in to comment.