}
@Test
public void testEarningsFromSecurity()
{
Client client = new Client();
Security security = new Security();
client.addSecurity(security);
Portfolio portfolio = new Portfolio();
portfolio.addTransaction(new PortfolioTransaction(Dates.date(2010, Calendar.JANUARY, 1), security,
PortfolioTransaction.Type.BUY, 10, 100, 0, 0));
client.addPortfolio(portfolio);
Account account = new Account();
account.addTransaction(new AccountTransaction(Dates.date(2011, Calendar.JANUARY, 31), security,
AccountTransaction.Type.INTEREST, 5000));
client.addAccount(account);
ClientPerformanceSnapshot snapshot = new ClientPerformanceSnapshot(client, startDate, endDate);
EnumMap<CategoryType, Category> result = snapshot.getCategoryMap();
assertEquals(5000, result.get(CategoryType.EARNINGS).getValuation());