diff --git a/docs/diagrams/UiClassDiagram.puml b/docs/diagrams/UiClassDiagram.puml index 650843a0cc9..8d9dbc14291 100644 --- a/docs/diagrams/UiClassDiagram.puml +++ b/docs/diagrams/UiClassDiagram.puml @@ -65,4 +65,4 @@ HelpWindow -[hidden]left- ReturnOrderListPanel HelpWindow -[hidden]down- ReturnOrderCard CommandBox -[hidden]left- ResultDisplay -@enduml \ No newline at end of file +@enduml diff --git a/docs/team/UMLDiagrams/[CS2103T-W12-01][Eng Xuan En]UML Diagrams.adoc b/docs/team/UMLDiagrams/[CS2103T-W12-01][Eng Xuan En]UML Diagrams.adoc index bbebd2bdef6..ea78ebdf1ea 100644 --- a/docs/team/UMLDiagrams/[CS2103T-W12-01][Eng Xuan En]UML Diagrams.adoc +++ b/docs/team/UMLDiagrams/[CS2103T-W12-01][Eng Xuan En]UML Diagrams.adoc @@ -9,20 +9,20 @@ This Activity Diagram purpose is to describe the general work flow of the Import useful for users, as it give them a general work flow of how Import command works and what they should expect out of Delino when performing a Import command. -image::ImportClassDiagram.svg[width=50%] +image::ImportClassDiagram.svg[width=45%] This Class Diagram purpose is to describe the dependencies of ImportCommand class when implementing this feature. This diagram is essential to our Delino application because it allows developer or users who are interested to better understand the underlying dependencies of ImportCommand class. -image::ImportCommandSequenceDiagram.svg[width=60%] +image::ImportCommandSequenceDiagram.svg[width=55%] image::ExecuteImportCommand.svg[width=55%] -This Sequence Diagram shows a more detailed explanation of the communication between the different classes used in +The two sequence diagrams show a more detailed explanation of the communication between the different classes used in the Logic and Model after the user execute the `import` command. This would allows the user to further understand how ImportCommand works after `import` Command being executed. * *Clear Feature UML Diagram* -image::ClearActivityDiagram.svg[width=60%] +image::ClearActivityDiagram.svg[width=55%] The purpose of this Activity Diagram is to describe the general work flow of the Clear feature. This diagram is especially useful for users, as it give them a general work flow of how Clear command works and what they should expect out of Delino when performing a Clear command. @@ -34,9 +34,9 @@ understand the underlying dependencies of SearchCommand class. image::ClearCommandSequenceDiagram.svg[width=50%] image::ExecuteClearCommand.svg[width=50%] -The two Sequence Diagram shows a more detailed explanation of the communication between the Logic and Model class of +The two sequence diagrams show a more detailed explanation of the communication between the Logic and Model class of Delino when the `clear` command is being executed. During the parsing of ClearCommandParser, it will check if the flags -in the arguments are valid and whether if both `-r` and `-o` flags found in the arguments which will throws +in the arguments are valid and whether if both `-r` and `-o` flags are found in the arguments which will throws ParseException if it fails the checks. This allows the user to be able to understand how the ClearCommand works after executing the `clear` Command. @@ -45,4 +45,4 @@ executing the `clear` Command. image::StorageClassDiagram.svg[width=50%] This Class Diagram purpose is to give a overview of a storage system in Delino, whereby StorageManager is interacting with Logic Manager through the interface, Storage. This is essential to Delino, as it allows the developer or users -who are interested to better understand the relationship between StorageManager and the other storage class. \ No newline at end of file +who are interested to better understand the relationship between StorageManager and the other storage class. diff --git a/src/main/java/seedu/delino/logic/parser/ParserUtil.java b/src/main/java/seedu/delino/logic/parser/ParserUtil.java index 3e7657aae5f..9e414833d05 100644 --- a/src/main/java/seedu/delino/logic/parser/ParserUtil.java +++ b/src/main/java/seedu/delino/logic/parser/ParserUtil.java @@ -185,6 +185,7 @@ public static void parse(List prefixList, ArgumentMultimap argMultimap) throw new ParseException(errorMessage); } } + //@@author Amoscheong97 /** * Parses a {@code String tid} into a {@code TransactionId}. * Leading and trailing whitespaces will be trimmed. @@ -199,7 +200,7 @@ public static TransactionId parseTid(String tid) throws ParseException { } return new TransactionId(trimmedTid); } - + //@@author /** * Parses a {@code String name} into a {@code Name}. * Leading and trailing whitespaces will be trimmed. @@ -259,7 +260,7 @@ public static Address parseAddress(String address) throws ParseException { } return new Address(trimmedAddress); } - + //@@author Exeexe93 /** * Parses a {@code String timeStamp} into an {@code TimeStamp}. * Leading and trailing whitespaces will be trimmed. @@ -282,7 +283,7 @@ public static TimeStamp parseTimeStamp(String timeStamp) throws ParseException { return new TimeStamp(trimmedTimeStamp, REQUIRE_CHECK_IF_TIMESTAMP_BEFORE_NOW); } - + //@@author JeremyLoh /** * Parses a {@code String address} into an {@code Warehouse}. * Leading and trailing whitespace will be removed. @@ -297,7 +298,7 @@ public static Warehouse parseWarehouse(String address) throws ParseException { } return new Warehouse(trimmedAddress); } - + //@@author Amoscheong97 /** * Parses a {@code String cod} into a {@code CashOnDelivery}. * Leading and trailing whitespaces will be trimmed. @@ -312,7 +313,7 @@ public static CashOnDelivery parseCash(String cod) throws ParseException { } return new CashOnDelivery(trimmedCash); } - + //@@author Exeexe93 /** * Parses a {@code String comment} into a {@code Comment}. * Leading and trailing whitespaces will be trimmed. @@ -329,7 +330,7 @@ public static Comment parseComment(String comment) throws ParseException { } return new Comment(trimmedComment); } - + //@@author Amoscheong97 /** * Parses a {@code String itemType} into a {@code TypeOfItem} * Leading and trailing whitespaces will be trimmed. diff --git a/src/main/java/seedu/delino/ui/MainWindow.java b/src/main/java/seedu/delino/ui/MainWindow.java index b3766b8e3dd..47dee35a701 100644 --- a/src/main/java/seedu/delino/ui/MainWindow.java +++ b/src/main/java/seedu/delino/ui/MainWindow.java @@ -202,7 +202,7 @@ void fillInnerParts() { // Try to start clock showTime(); } - + //@@author Exeexe93 /** * Print out start up message to user. */ @@ -214,7 +214,7 @@ private void printStartUpMessage() { } resultDisplay.setFeedbackToUser(printMessage); } - + //@@author /** * Sets the default size based on {@code guiSettings}. */ @@ -254,7 +254,6 @@ public void handleClearWarning(String warningMessage) { clearWindow.focus(); } } - //@@author //@@Amoscheong97 /** diff --git a/src/test/java/seedu/delino/logic/commands/ClearCommandTest.java b/src/test/java/seedu/delino/logic/commands/ClearCommandTest.java index 442d7c44fe7..73eed6527f0 100644 --- a/src/test/java/seedu/delino/logic/commands/ClearCommandTest.java +++ b/src/test/java/seedu/delino/logic/commands/ClearCommandTest.java @@ -20,7 +20,7 @@ import seedu.delino.model.OrderBook; import seedu.delino.model.ReturnOrderBook; import seedu.delino.model.UserPrefs; - +//@@author Exeexe93 public class ClearCommandTest { private HashSet flags; diff --git a/src/test/java/seedu/delino/model/parcel/comment/CommentTest.java b/src/test/java/seedu/delino/model/parcel/optionalparcelattributes/CommentTest.java similarity index 93% rename from src/test/java/seedu/delino/model/parcel/comment/CommentTest.java rename to src/test/java/seedu/delino/model/parcel/optionalparcelattributes/CommentTest.java index eec988e31e9..ad76a337a3b 100644 --- a/src/test/java/seedu/delino/model/parcel/comment/CommentTest.java +++ b/src/test/java/seedu/delino/model/parcel/optionalparcelattributes/CommentTest.java @@ -1,4 +1,4 @@ -package seedu.delino.model.parcel.comment; +package seedu.delino.model.parcel.optionalparcelattributes; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -7,8 +7,6 @@ import org.junit.jupiter.api.Test; -import seedu.delino.model.parcel.optionalparcelattributes.Comment; - //@@author Exeexe93 class CommentTest { @Test diff --git a/src/test/java/seedu/delino/model/parcel/itemtype/TypeOfItemTest.java b/src/test/java/seedu/delino/model/parcel/optionalparcelattributes/TypeOfItemTest.java similarity index 90% rename from src/test/java/seedu/delino/model/parcel/itemtype/TypeOfItemTest.java rename to src/test/java/seedu/delino/model/parcel/optionalparcelattributes/TypeOfItemTest.java index dccfdb09654..e5b6f7c693d 100644 --- a/src/test/java/seedu/delino/model/parcel/itemtype/TypeOfItemTest.java +++ b/src/test/java/seedu/delino/model/parcel/optionalparcelattributes/TypeOfItemTest.java @@ -1,4 +1,4 @@ -package seedu.delino.model.parcel.itemtype; +package seedu.delino.model.parcel.optionalparcelattributes; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -6,8 +6,6 @@ import org.junit.jupiter.api.Test; -import seedu.delino.model.parcel.optionalparcelattributes.TypeOfItem; - public class TypeOfItemTest { @Test public void constructor_null_throwsNullPointerException() { diff --git a/src/test/java/seedu/delino/model/parcel/returnorder/ReturnOrderBookTest.java b/src/test/java/seedu/delino/model/parcel/returnorder/ReturnOrderBookTest.java deleted file mode 100644 index 882ff4b51a1..00000000000 --- a/src/test/java/seedu/delino/model/parcel/returnorder/ReturnOrderBookTest.java +++ /dev/null @@ -1,104 +0,0 @@ -package seedu.delino.model.parcel.returnorder; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static seedu.delino.logic.commands.CommandTestUtil.VALID_ADDRESS_BOB; -import static seedu.delino.logic.commands.CommandTestUtil.VALID_TYPE_PLASTIC; -import static seedu.delino.testutil.Assert.assertThrows; -import static seedu.delino.testutil.TypicalReturnOrders.ALICE_RETURN; -import static seedu.delino.testutil.TypicalReturnOrders.getTypicalReturnOrderBook; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import org.junit.jupiter.api.Test; - -import javafx.collections.FXCollections; -import javafx.collections.ObservableList; -import seedu.delino.model.ReadOnlyReturnOrderBook; -import seedu.delino.model.ReturnOrderBook; -import seedu.delino.model.parcel.exceptions.DuplicateReturnOrderException; -import seedu.delino.testutil.ReturnOrderBuilder; - -class ReturnOrderBookTest { - private final ReturnOrderBook returnOrderBook = new ReturnOrderBook(); - - @Test - public void constructor() { - assertEquals(Collections.emptyList(), returnOrderBook.getReturnOrderList()); - } - - @Test - public void resetData_null_throwsNullPointerException() { - assertThrows(NullPointerException.class, () -> returnOrderBook.resetData(null)); - } - - @Test - public void resetData_withValidReadOnlyOrderBook_replacesData() { - ReturnOrderBook newData = getTypicalReturnOrderBook(); - returnOrderBook.resetData(newData); - assertEquals(newData, returnOrderBook); - } - - @Test - public void resetData_withDuplicateReturnOrders_throwsDuplicateReturnOrderException() { - // Two orders with the same identity fields - ReturnOrder editedAlice = new ReturnOrderBuilder(ALICE_RETURN) - .withAddress(VALID_ADDRESS_BOB) - .withItemType(VALID_TYPE_PLASTIC) - .build(); - List newReturnOrders = Arrays.asList(ALICE_RETURN, editedAlice); - ReturnOrderBookTest.ReturnOrderBookStub newData = new ReturnOrderBookTest.ReturnOrderBookStub(newReturnOrders); - - assertThrows(DuplicateReturnOrderException.class, () -> returnOrderBook.resetData(newData)); - } - - @Test - public void hasOrder_nullOrder_throwsNullPointerException() { - assertThrows(NullPointerException.class, () -> returnOrderBook.hasReturnOrder(null)); - } - - @Test - public void hasOrder_orderNotInOrderBook_returnsFalse() { - assertFalse(returnOrderBook.hasReturnOrder(ALICE_RETURN)); - } - - @Test - public void hasOrder_orderInOrderBook_returnsTrue() { - returnOrderBook.addReturnOrder(ALICE_RETURN); - assertTrue(returnOrderBook.hasReturnOrder(ALICE_RETURN)); - } - - @Test - public void hasOrder_orderWithSameIdentityFieldsInOrderBook_returnsTrue() { - returnOrderBook.addReturnOrder(ALICE_RETURN); - ReturnOrder editedAlice = new ReturnOrderBuilder(ALICE_RETURN) - .withAddress(VALID_ADDRESS_BOB).withItemType(VALID_TYPE_PLASTIC).build(); - assertTrue(returnOrderBook.hasReturnOrder(editedAlice)); - } - - @Test - public void getOrderList_modifyList_throwsUnsupportedOperationException() { - assertThrows(UnsupportedOperationException.class, () -> returnOrderBook.getReturnOrderList().remove(0)); - } - - /** - * A stub ReadOnlyReturnOrderBook whose orders list can violate interface constraints. - */ - private static class ReturnOrderBookStub implements ReadOnlyReturnOrderBook { - private final ObservableList returnOrders = FXCollections.observableArrayList(); - - ReturnOrderBookStub(Collection returnOrders) { - this.returnOrders.setAll(returnOrders); - } - - @Override - public ObservableList getReturnOrderList() { - return returnOrders; - } - } - -} diff --git a/src/test/java/seedu/delino/storage/returnorder/JsonAdaptedReturnOrderTest.java b/src/test/java/seedu/delino/storage/returnorder/JsonAdaptedReturnOrderTest.java index faa670a9709..f71c38e9d2e 100644 --- a/src/test/java/seedu/delino/storage/returnorder/JsonAdaptedReturnOrderTest.java +++ b/src/test/java/seedu/delino/storage/returnorder/JsonAdaptedReturnOrderTest.java @@ -18,6 +18,7 @@ import seedu.delino.model.parcel.parcelattributes.TransactionId; import seedu.delino.model.parcel.parcelattributes.Warehouse; +//@@author Exeexe93 public class JsonAdaptedReturnOrderTest { private static final String INVALID_TID = " "; private static final String INVALID_NAME = "R@chel"; @@ -25,7 +26,6 @@ public class JsonAdaptedReturnOrderTest { private static final String INVALID_EMAIL = "1234gg.com"; private static final String INVALID_ADDRESS = " "; private static final String INVALID_TIMESTAMP = "2019-02-32 1500"; - private static final String INVALID_TIMESTAMP_BEFORE_NOW = "2019-02-02 1500"; private static final String INVALID_WAREHOUSE = ""; private static final String INVALID_COMMENT = " "; private static final String INVALID_TYPE = "#bottle"; diff --git a/src/test/java/seedu/delino/testutil/TypicalReturnOrders.java b/src/test/java/seedu/delino/testutil/TypicalReturnOrders.java index d7043357237..712be25312c 100644 --- a/src/test/java/seedu/delino/testutil/TypicalReturnOrders.java +++ b/src/test/java/seedu/delino/testutil/TypicalReturnOrders.java @@ -24,6 +24,7 @@ import seedu.delino.model.ReturnOrderBook; import seedu.delino.model.parcel.returnorder.ReturnOrder; +//@@author Exeexe93 /** * A utility class containing a list of {@code ReturnOrder} objects to be used in tests. */