use of name.abuchen.portfolio.model.AccountTransaction in project portfolio by buchen.
the class IBFlexStatementExtractorTest method assertFeeRefund.
private void assertFeeRefund(Optional<Item> item) {
assertThat(item.isPresent(), is(true));
assertThat(item.get().getSubject(), instanceOf(AccountTransaction.class));
AccountTransaction entry = (AccountTransaction) item.get().getSubject();
assertThat(entry.getType(), is(Type.FEES_REFUND));
assertThat(entry.getMonetaryAmount(), is(Money.of("USD", 9_18L)));
assertThat(entry.getDateTime(), is(LocalDateTime.parse("2017-05-03T00:00")));
}
use of name.abuchen.portfolio.model.AccountTransaction in project portfolio by buchen.
the class IBFlexStatementExtractorTest method assertTax.
private void assertTax(Optional<Item> item) {
assertThat(item.isPresent(), is(true));
assertThat(item.get().getSubject(), instanceOf(AccountTransaction.class));
AccountTransaction entry = (AccountTransaction) item.get().getSubject();
assertThat(entry.getType(), is(Type.TAXES));
assertThat(entry.getMonetaryAmount(), is(Money.of("USD", 2_07L)));
assertThat(entry.getDateTime(), is(LocalDateTime.parse("2017-09-15T00:00")));
}
use of name.abuchen.portfolio.model.AccountTransaction in project portfolio by buchen.
the class IBFlexStatementExtractorTest method assertInterestCharge.
private void assertInterestCharge(Optional<Item> item) {
assertThat(item.isPresent(), is(true));
assertThat(item.get().getSubject(), instanceOf(AccountTransaction.class));
AccountTransaction entry = (AccountTransaction) item.get().getSubject();
assertThat(entry.getType(), is(Type.INTEREST_CHARGE));
assertThat(entry.getMonetaryAmount(), is(Money.of("CAD", 15_17L)));
assertThat(entry.getDateTime(), is(LocalDateTime.parse("2013-02-05T00:00")));
}
use of name.abuchen.portfolio.model.AccountTransaction in project portfolio by buchen.
the class IBFlexStatementExtractorTest method assertFee.
private void assertFee(Optional<Item> item) {
assertThat(item.isPresent(), is(true));
assertThat(item.get().getSubject(), instanceOf(AccountTransaction.class));
AccountTransaction entry = (AccountTransaction) item.get().getSubject();
assertThat(entry.getType(), is(Type.FEES));
assertThat(entry.getMonetaryAmount(), is(Money.of("USD", 9_18L)));
assertThat(entry.getDateTime(), is(LocalDateTime.parse("2017-05-03T00:00")));
}
use of name.abuchen.portfolio.model.AccountTransaction in project portfolio by buchen.
the class CheckCurrenciesAccountTransactionTest method testTransactionCurrencyMatchesAccount.
@Test
public void testTransactionCurrencyMatchesAccount() {
Account account = new Account();
account.setCurrencyCode("EUR");
AccountTransaction t = new AccountTransaction();
t.setMonetaryAmount(Money.of("EUR", 1_00));
assertThat(action.process(t, account).getCode(), is(Status.Code.OK));
t.setMonetaryAmount(Money.of("USD", 1_00));
assertThat(action.process(t, account).getCode(), is(Status.Code.ERROR));
}
Aggregations