Beispiel #1
0
 /// <summary>
 /// The logic for AddProduct.
 /// </summary>
 /// <param name="product">The product to be added.</param>
 private void AddProductCommand(Product product)
 {
     _salesController.AddProductToOrder(product, _numpad.Amount, new Discount {
         Description = "No DISCOUNT FOR YOU", Percent = 0
     });
     _numpad.ClearNumpad();
 }
        public void StartPayment_ProductIsAddedToOrderExactAmountIsPayed_OrderDaoUpdateIsCalledOnce()
        {
            var product = new Product("Beer", 18, true);

            _salesController.AddProductToOrder(product, 1, null);
            _salesController.StartPayment(18, "", PaymentType.Cash);

            _orderDao.Received(1).Update(Arg.Any <SalesOrder>());
        }
        public void AddProduct_ProductIsAddedToOrder_OrderLineContainsProduct()
        {
            var product = new Product("Beer", 18, true);

            _salesController.AddProductToOrder(product, 1, null);

            Assert.That(_orderLines[0].Product, Is.EqualTo(product));
        }
 private void AddingProductToOrder(Product product, int quantity, Discount discount)
 {
     _uut.AddProductToOrder(product, quantity, discount);
 }
 public void AddProductToOrder_SalesControllerCallsDalFacade_ProductAdded()
 {
     _salesController.AddProductToOrder(_product, 1, _discount);
     _dalFacade.UnitOfWork.OrderLineRepository.Received(1).Insert(Arg.Any <OrderLine>());
 }