private static ProfitAnalysis GetOptimalProfit(params TradePrice[] prices) { var set = new HashSet <TradePrice>(prices); var stockHistory = new StockHistory(set); return(stockHistory.GetOptimalProfitPeriod()); }
public void GetOptimalProfitPeriod_ShouldPriceValuesWhenTradeHistoryOfOne() { var price = TradePrice.Create(new DateTime(2010, 01, 01), 56, 93); var set = new HashSet <TradePrice> { price }; var stockHistory = new StockHistory(set); var optimalProfit = stockHistory.GetOptimalProfitPeriod(); Assert.IsTrue(ValuesEqual(price, optimalProfit)); }