static void Main(string[] args) { StockService stockService = new StockService(); BuyStock buyStock = new BuyStock(stockService); SellStock sellStock = new SellStock(stockService); StockController controller = new StockController(); controller.AddOrder(buyStock); controller.AddOrder(sellStock); controller.AddOrder(buyStock); controller.AddOrder(sellStock); controller.ExecuteOrders(); Console.Read(); }
public SellStock(StockService stockService) { _stockService = stockService; }
public BuyStock(StockService stockService) { _stockService = stockService; }