Package com.wesabe.api.accounts.entities

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


    @Before
    public void setup() {
      final Account account = new Account("Checking", USD);
      final Txaction txaction = new Txaction(account, decimal("-30.00"), date(2009, 2, 13));
      txaction.addTag(new Tag("food"));

      final IntervalSummarizer summarizer = new IntervalSummarizer(new CurrencyExchangeRateMap());
      this.summaries = summarizer.summarize(ImmutableList.of(txaction), interval, IntervalType.MONTHLY, USD, null);
    }
View Full Code Here


    protected TaggedAmount taggedAmount;
    protected TaggedAmountPresenter presenter;

    public void setup() throws Exception {
      this.taggedAmount = mock(TaggedAmount.class);
      when(taggedAmount.getTag()).thenReturn(new Tag("food"));
     
      this.presenter = new TaggedAmountPresenter(new MoneyPresenter());
    }
View Full Code Here

    private MonetarySummaryWithSplits summary;
    private IntervalSummaryPresenter presenter;
   
    @Before
    public void setup() throws Exception {
      this.food = new Tag("food");
     
      this.foodSummary = new MonetarySummary(new SumOfMoney(money("45.00", USD), 6), new SumOfMoney(Money.zero(USD), 0));
     
      this.presenter = new IntervalSummaryPresenter(new SumOfMoneyPresenter((new MoneyPresenter())));
     
View Full Code Here

      wholeFoods.setStatus(TxactionStatus.ACTIVE);
      interestEarned.setStatus(TxactionStatus.ACTIVE);
     
      txactions = ImmutableList.of(starbucks, interestEarned, wholeFoods);
     
      starbucks.addTag(new Tag("food"));
      wholeFoods.addTag(new Tag("food"));
     
      foodTxactions = Lists.newArrayList(starbucks, wholeFoods);
    }
View Full Code Here

      assertEquals(Integer.valueOf(300), taggedAmount.getId());
    }
   
    @Test
    public void itHasATag() throws Exception {
      assertEquals(new Tag("food"), taggedAmount.getTag());
    }
View Full Code Here

import com.wesabe.api.accounts.entities.Tag;

public class TagHelper {
  public static Tag tag(String name) {
    return new Tag(name);
  }
View Full Code Here

      assertEquals(ImmutableList.of(starbucks), list.getTxactions());
    }
   
    @Test
    public void itReturnsTxactionsWithTagNamesContainingTheQuery() throws Exception {
      inject(Txaction.class, starbucks, "taggedAmounts", ImmutableList.of(new TaggedAmount(starbucks, new Tag("snack"), null)));
     
      final TxactionList list = buildTxactionList("Snack");
      assertEquals(ImmutableList.of(starbucks), list.getTxactions());
    }
View Full Code Here

   
    @Before
    public void setup() throws Exception {
      this.presenter = new TagSummaryPresenter(new SumOfMoneyPresenter((new MoneyPresenter())));
     
      this.tag = new Tag("food");
     
      this.summary = new MonetarySummary(
        new SumOfMoney(money("3409.32", USD), 17),
        new SumOfMoney(money("2091.11", USD), 5)
      );
View Full Code Here

   
    @Test
    public void itLimitsTheTransactionListToThoseTags() throws Exception {
      resource.show(context.getUser(), Locale.CANADA_FRENCH, currency, uneditedOnly, limit, offset, startDate, endDate, accountUris, tagUris, merchantNames, amount, query);
     
      verify(context.getTxactionListBuilder()).setTags(ImmutableSet.of(new Tag("food")));
    }
View Full Code Here

   
    @Test
    public void itLimitsTheTransactionListToThoseTags() throws Exception {
      resource.show(context.getUser(), Locale.CANADA_FRENCH, currency, uneditedOnly, limit, offset, startDate, endDate, accountUris, tagUris, merchantNames, amount, query);
     
      verify(context.getTxactionListBuilder()).setTags(ImmutableSet.of(new Tag("either/or")));
    }
View Full Code Here

TOP

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

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.