Exemple #1
0
        public void CalculateMomentumTest(string inCutDate, int stockCount, double outTrainAverage, double outTestAverage, double outStocksToBuyAverage)
        {
            var momentumDetail = _service.CalculateMomentum(_prices, DateTime.Parse(inCutDate), stockCount);

            Assert.AreEqual(momentumDetail.TrainAverage, outTrainAverage, "Train average doesn't match");
            Assert.AreEqual(momentumDetail.TestAverage, outTestAverage, "Test average doesn't match");
            Assert.AreEqual(momentumDetail.StocksToBuyAverage, outStocksToBuyAverage, "Stocks to buy average doesn't match");
            Assert.AreEqual(momentumDetail.StocksToBuy.Count(), stockCount, "Stock count doesn't match");
        }