public void CheapifiedPortfolioProvidesFullDependencyCover() { var portfolioName = "EMRATES"; var cobDate = DateTime.Parse("23 Jul 2017"); var portfolio = _portfolioProvider.GetPortfolio(portfolioName, cobDate); IPortfolioMinifier cheapifier = new Cheapifier(); var cheapifiedPortfolio = cheapifier.Minify(portfolio, _portfolioCostProvider.GetPortfolioCosts(portfolioName, cobDate)); portfolio.MarketDependencies.Intersect(cheapifiedPortfolio.MarketDependencies).Count().Should().Be(portfolio.MarketDependencies.Count()); }
public void CheapifiedPortfolioHasOneTradeAtLeastPerTradeType() { var portfolioName = "EMRATES"; var cobDate = DateTime.Parse("23 Jul 2017"); var portfolio = _portfolioProvider.GetPortfolio(portfolioName, cobDate); IPortfolioMinifier cheapifier = new Cheapifier(); var cheapifiedPortfolio = cheapifier.Minify(portfolio, _portfolioCostProvider.GetPortfolioCosts(portfolioName, cobDate)); var tradeTypeUniverse = portfolio.Trades.Select(t => t.TradeType).Distinct(); var cheapifiedPortfolioTradeTypeUniverse = cheapifiedPortfolio.Trades.Select(t => t.TradeType).Distinct(); tradeTypeUniverse.Intersect(cheapifiedPortfolioTradeTypeUniverse).Count().Should().Be(tradeTypeUniverse.Count()); }