Package com.wesabe.api.accounts.entities

Examples of com.wesabe.api.accounts.entities.AccountList


    @Test
    public void itReturnsTxactionsExcludingTheOffsetOnes() {
      assertEquals(Lists.newArrayList(starbucks, wholeFoods), new TxactionListBuilder()
                        .setOffset(1)
                        .setAccounts(new AccountList(checking, savings))
                        .setCurrency(USD)
                        .setCurrencyExchangeRateMap(exchangeRates)
                        .build(txactions)
                        .getTxactions());
    }
View Full Code Here


   
    @Test
    public void itIncludesTheOffsetTransactionsInTheTotalCount() throws Exception {
      final TxactionList list = new TxactionListBuilder()
                    .setOffset(1)
                    .setAccounts(new AccountList(checking, savings))
                    .setCurrency(USD)
                    .setCurrencyExchangeRateMap(exchangeRates)
                    .build(txactions);
      assertEquals(3, list.getTotalCount());
    }
View Full Code Here

    @Test
    public void itReturnsTxactionsExcludingTheOffsetOnes() {
      assertEquals(Lists.newArrayList(interestEarned, starbucks), new TxactionListBuilder()
                        .setLimit(2)
                        .setAccounts(new AccountList(checking, savings))
                        .setCurrency(USD)
                        .setCurrencyExchangeRateMap(exchangeRates)
                        .build(txactions)
                        .getTxactions());
    }
View Full Code Here

   
    @Test
    public void itIncludesTheLimitedTransactionsInTheTotalCount() throws Exception {
      final TxactionList list = new TxactionListBuilder()
                      .setOffset(1)
                      .setAccounts(new AccountList(checking, savings))
                      .setCurrency(USD)
                      .setCurrencyExchangeRateMap(exchangeRates)
                      .build(txactions);
      assertEquals(3, list.getTotalCount());
    }
View Full Code Here

    public void setup() throws Exception {
      this.context = new MockResourceContext();
     
      this.account = mock(Account.class);
      when(account.getRelativeId()).thenReturn(1);
      this.accounts = new AccountList(account);
      when(context.getAccountDAO().findVisibleAccounts(Mockito.anyString())).thenReturn(accounts);
     
      this.txaction = mock(Txaction.class);
      this.filteredTxaction = mock(Txaction.class);
      this.txactions = ImmutableList.of(txaction, filteredTxaction);
View Full Code Here

    public void itPresentsTheAccountList() throws Exception {
      final XmlsonObject representation = resource.show(context.getUser(), Locale.CANADA_FRENCH, currency, includeArchived);
     
      assertThat(representation, is(sameInstance(xmlson)));
     
      verify(context.getAccountListPresenter()).present(new AccountList(accounts), USD, Locale.CANADA_FRENCH);
    }
View Full Code Here

      savings.setRelativeId(1);
     
      this.weirdOne = new Account("Brian Has Insane Accounts", USD);
      weirdOne.setRelativeId(400);
     
      when(context.getAccountDAO().findVisibleAccounts(anyString())).thenReturn(new AccountList(checking, savings, weirdOne));
     
      this.accountUris = ImmutableSet.of(new UriParam("/accounts/2"), new UriParam("/accounts/400"));
    }
View Full Code Here

   
    @Test
    public void itLimitsTheTransactionListToThoseAccounts() throws Exception {
      resource.show(context.getUser(), Locale.CANADA_FRENCH, currency, uneditedOnly, limit, offset, startDate, endDate, accountUris, tagUris, merchantNames, amount, query);
     
      verify(context.getTxactionListBuilder()).setAccounts(new AccountList(checking, weirdOne));
    }
View Full Code Here

      checking.setRelativeId(2);
     
      this.savings = new Account("Savings", USD);
      savings.setRelativeId(1);
     
      when(context.getAccountDAO().findVisibleAccounts(anyString())).thenReturn(new AccountList(checking, savings));
     
      this.accountUris = ImmutableSet.of(new UriParam("/accounts/2"), new UriParam("/accounts/woof"), new UriParam("/accouFFFnts/2"));
    }
View Full Code Here

   
    @Test
    public void itIgnoresMalformedAccountURIs() throws Exception {
      resource.show(context.getUser(), Locale.CANADA_FRENCH, currency, uneditedOnly, limit, offset, startDate, endDate, accountUris, tagUris, merchantNames, amount, query);
     
      verify(context.getTxactionListBuilder()).setAccounts(new AccountList(checking));
    }
View Full Code Here

TOP

Related Classes of com.wesabe.api.accounts.entities.AccountList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.