@Test public void test_Wallets_Transactions() throws Exception { UserNatural john = this.getJohn(); Wallet wallet = this.getJohnsWallet(); PayIn payIn = this.getJohnsPayInCardWeb(); Pagination pagination = new Pagination(1, 1); FilterTransactions filter = new FilterTransactions(); filter.Type = TransactionType.PAYIN; List<Transaction> transactions = this._api.Wallets.getTransactions(wallet.Id, pagination, filter); assertTrue(transactions.size() == 1); assertTrue(transactions.get(0) instanceof Transaction); assertEquals(transactions.get(0).AuthorId, john.Id); this.assertEqualInputProps(transactions.get(0), payIn); }
@Test public void test_Wallets_Transactions_SortByCreationDate() throws Exception { Wallet wallet = this.getJohnsWallet(); // create two payin objects this.getJohnsPayInCardWeb(); this.holdOn(2); this.getNewPayInCardWeb(); Sorting sorting = new Sorting(); sorting.addField("CreationDate", SortDirection.desc); Pagination pagination = new Pagination(1, 20); FilterTransactions filter = new FilterTransactions(); filter.Type = TransactionType.PAYIN; List<Transaction> transactions = this._api.Wallets.getTransactions(wallet.Id, pagination, filter, sorting); assertNotNull(transactions); assertTrue(transactions.size() > 1); assertTrue(transactions.get(0).CreationDate > transactions.get(1).CreationDate); }