Пример #1
0
        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();
        }
Пример #2
0
 public SellStock(StockService stockService)
 {
     _stockService = stockService;
 }
Пример #3
0
 public BuyStock(StockService stockService)
 {
     _stockService = stockService;
 }