示例#1
0
        public void Test_open_should_return_total_stocks_quantity()
        {
            StockHistory history    = new StockHistory();
            Quote        quote      = new Quote(2, 4);
            Broker       broker     = new Broker(50);
            Investment   investment = new Investment(history, broker);

            DateTime openDate        = new DateTime(2020, 2, 10);
            DateTime closeDate       = new DateTime(2020, 4, 10);
            DateTime februaryBuyDate = new DateTime(2020, 2, 28);
            DateTime marchBuyDate    = new DateTime(2020, 3, 27);
            double   stocksQuantity  = 10;
            double   amount          = 20;

            history.Add(februaryBuyDate, quote);
            history.Add(marchBuyDate, quote);

            Assert.AreEqual(stocksQuantity, investment.Open(openDate, closeDate, amount));
        }