use of name.abuchen.portfolio.snapshot.AccountSnapshot in project portfolio by buchen.
the class CurrencyTestCase method testClientSnapshot.
@Test
public void testClientSnapshot() {
LocalDate requestedTime = LocalDate.parse("2015-01-16");
ClientSnapshot snapshot = ClientSnapshot.create(client, converter, requestedTime);
AccountSnapshot accountEURsnapshot = lookupAccountSnapshot(snapshot, accountEUR);
assertThat(accountEURsnapshot.getFunds(), is(Money.of(CurrencyUnit.EUR, 1000_00)));
assertThat(accountEURsnapshot.getUnconvertedFunds(), is(Money.of(CurrencyUnit.EUR, 1000_00)));
AccountSnapshot accountUSDsnapshot = lookupAccountSnapshot(snapshot, accountUSD);
assertThat(accountUSDsnapshot.getFunds(), is(Money.of(CurrencyUnit.EUR, Math.round(1000_00 * (1 / 1.1588)))));
assertThat(accountUSDsnapshot.getUnconvertedFunds(), is(Money.of("USD", 1000_00)));
GroupByTaxonomy grouping = snapshot.groupByTaxonomy(client.getTaxonomy("30314ba9-949f-4bf4-944e-6a30802f5190"));
testTotals(snapshot, grouping);
testAssetCategories(grouping);
testUSDAssetPosition(grouping);
}
Aggregations