@Test
public void testThatPartialAssignmentsAreSeparated()
{
Client client = new Client();
Taxonomy taxonomy = new TaxonomyBuilder() //
.addClassification("debt") //
.addClassification("equity") //
.addTo(client);
Security a = new SecurityBuilder() //
.addPrice("2010-01-01", 1000) //
.assign(taxonomy, "debt", Classification.ONE_HUNDRED_PERCENT / 2) //
.assign(taxonomy, "equity", Classification.ONE_HUNDRED_PERCENT / 2) //
.addTo(client);
Portfolio portfolio = new PortfolioBuilder() //
.inbound_delivery(a, "2010-01-01", 1000000, 10000) //
.addTo(client);
PortfolioSnapshot snapshot = PortfolioSnapshot.create(portfolio, new DateTime("2010-01-01").toDate());
assertNotNull(snapshot);
GroupByTaxonomy grouping = snapshot.groupByTaxonomy(taxonomy);
AssetCategory debt = grouping.byClassification(taxonomy.getClassificationById("debt"));
assertThat(debt.getValuation(), is(5000L));
assertThat(debt.getPositions().size(), is(1));
AssetCategory equity = grouping.byClassification(taxonomy.getClassificationById("equity"));
assertThat(equity.getValuation(), is(5000L));
assertThat(equity.getPositions().size(), is(1));
}