示例#1
0
        private static ProfitAnalysis GetOptimalProfit(params TradePrice[] prices)
        {
            var set = new HashSet <TradePrice>(prices);

            var stockHistory = new StockHistory(set);

            return(stockHistory.GetOptimalProfitPeriod());
        }
示例#2
0
        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));
        }