Beispiel #1
0
        public void Test_SetStockPrice_NewPrice()
        {
            string stockName = "IBM";
            decimal oldPrice = 10m;
            _stockExchange.ListStock(stockName, 1000000, oldPrice, new DateTime(2012, 1, 10, 15, 22, 00));
            decimal newPrice = 20m;
            _stockExchange.SetStockPrice(stockName, new DateTime(2012, 1, 10, 15, 40, 00), newPrice);

            Assert.AreEqual(newPrice, _stockExchange.GetStockPrice(stockName, new DateTime(2012, 1, 10, 15, 50, 0, 0)));
        }
Beispiel #2
0
        public void Test_GetStockPrice_BeforeAlPrices()
        {
            // Postavlja više cijena i dohvaćanje cijenu prije svih trenutaka

            string dionica1 = "Dionica1";

            _stockExchange.ListStock(dionica1, 1000000, 10m, new DateTime(2014, 1, 1, 0, 0, 0, 0));     // 1.1.2014.
            _stockExchange.SetStockPrice(dionica1, new DateTime(2014, 1, 2, 0, 0, 0, 0), 100m);         // 2.1.2014.

            _stockExchange.GetStockPrice(dionica1, new DateTime(2013, 1, 1, 0, 0, 0, 0));               // 1.1.2013.    dionica tada nije ni postojala - exception
        }