forked from nus-cs2103-AY2122S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 3
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 #201 from bernarduskrishna/testing-model
Add tests for model.
- Loading branch information
Showing
14 changed files
with
293 additions
and
15 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
53 changes: 53 additions & 0 deletions
53
src/test/java/seedu/address/model/TransactionListTest.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,53 @@ | ||
package seedu.address.model; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
import static seedu.address.testutil.TypicalTransactions.getTypicalTransactionList; | ||
import static seedu.address.testutil.TypicalTransactions.getTypicalTransactionList2; | ||
import static seedu.address.testutil.TypicalTransactions.getTypicalTransactionList3; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class TransactionListTest { | ||
|
||
private TransactionList transactionList1 = getTypicalTransactionList(); | ||
private TransactionList transactionList2 = getTypicalTransactionList2(); | ||
private TransactionList transactionList3 = getTypicalTransactionList3(); | ||
private TransactionList transactionList1Copy = getTypicalTransactionList(); | ||
|
||
@Test | ||
public void equalSameObject() { | ||
assertTrue(transactionList1.equals(transactionList1)); | ||
} | ||
|
||
@Test | ||
public void unequalNonTransaction() { | ||
assertFalse(transactionList1.equals(1)); | ||
} | ||
|
||
@Test | ||
public void equalTestTransactionList() { | ||
assertTrue(transactionList1.equalTestsTransactionLists(transactionList1)); | ||
} | ||
|
||
@Test | ||
public void unequalTestTransactionList_nonTransaction() { | ||
assertFalse(transactionList1.equalTestsTransactionLists(1)); | ||
} | ||
|
||
@Test | ||
public void unequalTestTransactionList_diffSize() { | ||
assertFalse(transactionList1.equalTestsTransactionLists(transactionList2)); | ||
} | ||
|
||
@Test | ||
public void unequalTestTransactionList_diffOrder() { | ||
assertFalse(transactionList2.equalTestsTransactionLists(transactionList3)); | ||
} | ||
|
||
@Test | ||
public void equalTestTransactionList_diffObject() { | ||
assertTrue(transactionList1.equalTestsTransactionLists(transactionList1Copy)); | ||
} | ||
|
||
} |
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
Oops, something went wrong.