forked from AY2324S1-CS2103-F13-2/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.
- Loading branch information
1 parent
bbccb47
commit 3643640
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/test/java/seedu/address/model/AddressBookListTest.java
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package seedu.address.model; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertThrows; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class AddressBookListTest { | ||
private final AddressBookList addressBookList = new AddressBookList(); | ||
|
||
@Test | ||
public void undo_success() { | ||
addressBookList.add(new AddressBook()); | ||
addressBookList.add(new AddressBook()); | ||
assertEquals(addressBookList.undo(), new AddressBook()); | ||
} | ||
|
||
@Test | ||
public void undo_failure() { | ||
assertThrows(IllegalArgumentException.class, () -> addressBookList.undo()); | ||
} | ||
|
||
@Test | ||
public void redo_success() { | ||
addressBookList.add(new AddressBook()); | ||
addressBookList.add(new AddressBook()); | ||
addressBookList.undo(); | ||
assertEquals(addressBookList.redo(), new AddressBook()); | ||
} | ||
|
||
@Test | ||
public void redo_failure() { | ||
assertThrows(IllegalArgumentException.class, () -> addressBookList.redo()); | ||
} | ||
} |
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