This repository has been archived by the owner on Apr 28, 2021. It is now read-only.
forked from nus-cs2103-AY1920S1/addressbook-level3
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #354 from fatclarence/branch-update-ug
Add savings test for SavingsHistory
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/test/java/seedu/savenus/model/savings/SavingsHistoryTest.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,32 @@ | ||
package seedu.savenus.model.savings; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static seedu.savenus.testutil.Assert.assertThrows; | ||
import static seedu.savenus.testutil.TypicalSavingsHistory.getTypicalSavingsHistory; | ||
|
||
import java.util.Collections; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
//@@author fatclarence | ||
public class SavingsHistoryTest { | ||
|
||
private final SavingsHistory savingsHistory = new SavingsHistory(); | ||
|
||
@Test | ||
public void constructor() { | ||
assertEquals(Collections.emptyList(), savingsHistory.getSavingsHistory()); | ||
} | ||
|
||
@Test | ||
public void resetData_null_throwsNullPointerException() { | ||
assertThrows(NullPointerException.class, () -> savingsHistory.resetData(null)); | ||
} | ||
|
||
@Test | ||
public void resetData_withValidReadOnlyMenu_replacesData() { | ||
SavingsHistory newData = getTypicalSavingsHistory(); | ||
savingsHistory.resetData(newData); | ||
assertEquals(newData, savingsHistory); | ||
} | ||
} |