Ejemplo n.º 1
0
        public void TestOne()
        {
            this.orderHeaderId = layer.CreateNewOrderHeader();

            IEnumerable <StockItem> allItems = layer.GetStockItems();

            double price = allItems.ElementAt(0).Price;

            OrderItem input = new OrderItem("In_stock", orderHeaderId, price,
                                            quantityOfStockItemTested, idOfStockItemTested, price * quantityOfStockItemTested);

            layer.UpsertOrderItem(input.Description, input.Price, input.OrderHeaderId,
                                  input.StockItemId, input.Quantity);

            OrderItem output = layer.ProcessOrder(orderHeaderId).ElementAt(0);

            //checking that the input and output are equal
            Assert.AreEqual(input.Description + " " + input.Price + " " + input.OrderHeaderId +
                            " " + input.StockItemId + " " + input.Quantity + " " + input.Total,
                            output.Description + " " + output.Price + " " + output.OrderHeaderId + " " +
                            output.StockItemId + " " + output.Quantity + " " + output.Total);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructor for AddOrderItem
 /// </summary>
 /// <param name="orderHeaderId">The unique ID of the order header</param>
 public AddOrderItemView(int orderHeaderId)
 {
     InitializeComponent();
     this.orderHeaderId = orderHeaderId;
     dgStockItems.ItemsSource = layer.GetStockItems();
 }