Ejemplo n.º 1
0
        public void TestDefinedStockRemove()
        {
            IDefinedStockContainer definedStockContainer = StockContainerCreator.GetDefinedStockContainer();

            definedStockContainer.Add(new Stock()
            {
                Name = "AAPL", ID = "AAPL"
            });
            definedStockContainer.Add(new Stock()
            {
                Name = "BIOX", ID = "BIOX"
            });
            definedStockContainer.Add(new Stock()
            {
                Name = "GHM", ID = "GHM"
            });
            definedStockContainer.Add(new Stock()
            {
                Name = "PALL", ID = "PALL"
            });
            definedStockContainer.Add(new Stock()
            {
                Name = "TRTY", ID = "TRTY"
            });
            definedStockContainer.Remove("AAPL");
            Assert.IsTrue(4 == definedStockContainer.Stocks.Count);
        }
Ejemplo n.º 2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            foreach (DataGridViewRow dr in dtGrdSearch.Rows)
            {
                var sel = dr.Cells[0].Value as bool?;

                if (sel.HasValue && sel.Value)
                {
                    definedStockContainer.Add(new Stock()
                    {
                        ID = (string)dr.Cells[1].Value, Name = (string)dr.Cells[2].Value
                    });
                }
            }
            //add to defined stock
        }