-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[T6A1][W10-B3] YinaToh #465
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we are now using StorageStub
in LogicTest
, we need not test the correctness of StorageFile
when we test the Logic
class. There is a line in the assertCommandBehavior
method that checks for the contents on the disk with the contents in memory; this should be removed.
@@ -45,11 +46,11 @@ void setAddressBook(AddressBook addressBook){ | |||
* Creates the StorageFile object based on the user specified path (if any) or the default storage path. | |||
* @throws StorageFile.InvalidStorageFilePathException if the target file path is incorrect. | |||
*/ | |||
private StorageFile initializeStorage() throws StorageFile.InvalidStorageFilePathException { | |||
private Storage initializeStorage() throws Storage.InvalidStoragePathException { | |||
return new StorageFile(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The creating of StorageFile
is a little unfortunate, but nonetheless has to be done. The original design already violates OCP. Fyi, an issue has been raised regarding this se-edu/addressbook-level3#75.
That aside, a good job in applying DIP 👍
import seedu.addressbook.data.AddressBook; | ||
import seedu.addressbook.data.exception.IllegalValueException; | ||
|
||
public abstract class Storage { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Header comments here?
public InvalidStoragePathException(String message) { | ||
super(message); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
} | ||
} | ||
|
||
public abstract void save(AddressBook addressBook) throws StorageOperationException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@Override | ||
public AddressBook load() throws StorageOperationException { | ||
// TODO Auto-generated method stub | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍...though it will be better to have StorageStub
in the test
directory, and careful with indentation
Ack by closing PR |
No description provided.