public void CreateOrder() { var orderEngine = new OrderEngine(ConnectionString, Provider); var order = new Order { CustomerId = "VINET", EmployeeId = 5, Freight = 32.38m, RequiredDate = new DateTime(1996, 08, 01), ShipAddress = "59 rue de l'Abbaye", ShipCity = "Reims", ShipCountry = "France", ShipName = "Vins et alcools Chevalier", ShipPostalCode = "51100", ShipRegion = null, ShipVia = 3, }; var orderId = orderEngine.GetNextOrderId(); orderEngine.CreateOrder(order); Assert.AreEqual(order, orderEngine.GetOrder(orderId)); }
public void DeleteOrder() { var order = new Order(); order.StartProcessing(DateTime.Today); var orderEngine = new OrderEngine(ConnectionString, Provider); var orderId = orderEngine.CreateOrder(order); orderEngine.DeleteOrder(orderId); Assert.IsNull(orderEngine.GetOrder(orderId)); }
public void EditNewOrder() { var order = new Order(); var orderEngine = new OrderEngine(ConnectionString, Provider); var newOrderId = orderEngine.CreateOrder(order); order.CustomerId = "VINET"; order.EmployeeId = 5; order.Freight = 32.38m; order.RequiredDate = new DateTime(1996, 08, 01); order.ShipAddress = "59 rue de l'Abbaye"; order.ShipCity = "Reims"; order.ShipCountry = "France"; order.ShipName = "Vins et alcools Chevalier"; order.ShipPostalCode = "51100"; order.ShipRegion = "SP"; order.ShipVia = 3; orderEngine.EditOrder(newOrderId, order); Assert.AreEqual(order, orderEngine.GetOrder(newOrderId)); }
/// <summary> /// Get orders /// </summary> /// <returns></returns> public List <Order> GetOrders() { return(orderEngine.GetOrder()); }
/// <summary> /// Get orders /// </summary> /// <returns></returns> public List <Order> GetOrders() { OrderEngine orderEngine = new OrderEngine(); return(orderEngine.GetOrder()); }