Skip to content
This repository has been archived by the owner on Apr 28, 2021. It is now read-only.

Commit

Permalink
Merge pull request #354 from fatclarence/branch-update-ug
Browse files Browse the repository at this point in the history
Add savings test for SavingsHistory
  • Loading branch information
seanlowjk authored Nov 11, 2019
2 parents b0103ca + 9f47ea8 commit b533ac9
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/test/java/seedu/savenus/model/savings/SavingsHistoryTest.java
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);
}
}

0 comments on commit b533ac9

Please sign in to comment.