Exemple #1
0
        public void Test_GetIndexValue_AfterDelistingStock()
        {
            // Provjera izračuna vrijednosti portfelja nakon brisanja dionice s burze

            string dionica1 = "Dionica1";

            _stockExchange.ListStock(dionica1, 100, 10m, DateTime.Now);
            string dionica2 = "Dionica2";

            _stockExchange.ListStock(dionica2, 100, 20m, DateTime.Now);


            string portfelj1 = "portfelj1";

            _stockExchange.CreatePortfolio(portfelj1);
            _stockExchange.AddStockToPortfolio(portfelj1, dionica1, 10);
            _stockExchange.AddStockToPortfolio(portfelj1, dionica2, 10);

            Assert.AreEqual(300, _stockExchange.GetPortfolioValue(portfelj1, DateTime.Now));

            _stockExchange.DelistStock(dionica1);

            Assert.AreEqual(200, _stockExchange.GetPortfolioValue(portfelj1, DateTime.Now));
        }