Created
March 13, 2011 15:23
-
-
Save NIA/868170 to your computer and use it in GitHub Desktop.
Мне самому не нравятся такие тесты, но...?
This file contains hidden or 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
| @Test | |
| public void testAccountsInitialization() { | |
| AccountTree.Account expenses; | |
| assertNotNull( expenses = findAccount("expenses", journal.getRootAccounts()) ); | |
| assertNotNull( findAccount("food", expenses.getChildren()) ); | |
| } | |
| @Test | |
| public void testTransactionsInitialization() throws Exception { | |
| List<Transaction> ts = journal.getTransactions(); | |
| Transaction t; | |
| assertNotNull(t = findByDateAndDesc("3-13", "first transaction")); | |
| Map<AccountTree.Account,BigDecimal> postings = t.getPostings(); | |
| AccountTree.Account[] accounts = new AccountTree.Account[2]; | |
| accounts = postings.keySet().toArray(accounts); | |
| assertEquals("expenses", accounts[0].getName()); | |
| assertEquals("assets", accounts[1].getName()); | |
| assertEquals("10", postings.get(accounts[0]).toString()); | |
| assertNull(postings.get(accounts[1])); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment