Пример #1
0
        // ����ѡ���IJ��Կ�ʼ����
        private void ExecTask(IFinanceStrategy strategy)
        {
            IStockValues values = new StockValues();

            Start(values, strategy);

            _results.AddResult(strategy.Name, values);
        }
Пример #2
0
        // 根据选定的策略开始计算
        private void ExecTask(IFinanceStrategy strategy)
        {
            IStockValues values = new StockValues();

            Start(values, strategy);

            _results.AddResult(strategy.Name, values);
        }
Пример #3
0
        public void SetTotalValue()
        {
            IStockValues values = new StockValues();

            values.SetTotalValue(new DateTime(2009, 3, 23), 10.0);
            Assert.AreEqual(values.GetAllDate().Count, 1);

            values.SetTotalValue(new DateTime(2009, 3, 24), 12.0);
            Assert.AreEqual(values.GetAllDate().Count, 2);

            values.SetTotalValue(new DateTime(2009, 3, 25), -1); // invalid
            Assert.AreEqual(values.GetAllDate().Count, 2);
        }
Пример #4
0
        public void GetTotalValue()
        {
            IStockValues values = new StockValues();

            DateTime dt = new DateTime(2009, 3, 23);
            values.SetTotalValue(dt, 10.0);

            double val = values.GetTotalValue(dt);
            Assert.AreEqual(val, 10.0);

            val = values.GetTotalValue(new DateTime(1980, 1, 1));
            Assert.IsTrue(val < 0);
        }