Beispiel #1
0
        public void PlaceOrder_ReturnsCoffeeOrder(CoffeeSize size, int creamQty, int sugarQty)
        {
            _coffeeOrderHandler.Size = size;

            AddExtra(Extra.Cream, creamQty);
            AddExtra(Extra.Sugar, sugarQty);

            var coffeeOrder = _coffeeOrderHandler.PlaceOrder();

            Assert.AreEqual(size.ToString(), coffeeOrder.Size);
            Assert.AreEqual(creamQty, coffeeOrder.CreamQty);
            Assert.AreEqual(sugarQty, coffeeOrder.SugarQty);
        }
        private void btnAddCoffee_Click(object sender, EventArgs e)
        {
            var coffeeOrder = _coffeeOrderHandler.PlaceOrder();

            _transactionHandler.AddCoffeeOrder(coffeeOrder);

            UpdateOrder();
            ClearAddCoffeeForm();
            SetStatus();
        }