示例#1
0
        public void GetTickerInfo()
        {
            Market market = new Market();

            market.AddStock(new Stock("ABC", 10));
            Assert.AreEqual(10.0, market.GetStockPrice("ABC"));
        }
 public static void PopulateMarket(Market market)
 {
     for (int i = 0; i < 10; i++)
     {
         Stock stock = new Stock(RandomString(3), 100);
         market.AddStock(stock);
     }
     Console.WriteLine("Market Populated:");
     foreach (Stock s in market.GetStocks())
     {
         Console.WriteLine(s.Symbol + " - $" + s.GetPrice());
     }
 }
示例#3
0
        public void AddNewInvalidTicker()
        {
            Market market = new Market();

            Assert.IsFalse(market.AddStock(new Stock("A1", 10)));
        }
示例#4
0
        public void AddNewTicker()
        {
            Market market = new Market();

            market.AddStock(new Stock("ABC", 10));
        }
 public void Init()
 {
     market.AddStock(new Stock("ABC", 10));
 }