Пример #1
0
        public void Test_if_add_stock_in_wallet()
        {
            Wallet wallet = new Wallet();

            double stocksQuantity = 3;
            double totalStocks    = 3;

            wallet.AddStocks(stocksQuantity);

            Assert.AreEqual(totalStocks, wallet.TotalStocks());
        }
Пример #2
0
        public void Test_close_should_return_total_investment_amount()
        {
            StockHistory history    = new StockHistory();
            Quote        quote      = new Quote(1, 2);
            Broker       broker     = new Broker(0);
            Investment   investment = new Investment(history, broker);

            DateTime closeDate = new DateTime(2020, 3, 1);
            Wallet   wallet    = new Wallet();

            wallet.AddStocks(10);
            double totalPrice = 20;

            history.Add(closeDate, quote);

            Assert.AreEqual(totalPrice, investment.Close(wallet, closeDate));
        }