public void CanRetrieveProductionOrdersByDate() { IOrderRepository data = new ProductionOrdersRepository(@"C:\Data\LiveData"); DateTime date = DateTime.Parse("01/01/1111"); List <Order> orders = data.RetrieveOrdersByDate(date); Assert.IsTrue(orders.Count > 1); }
public void CanCreateProductionOrder() { IOrderRepository data = new ProductionOrdersRepository(@"C:\Data\LiveData"); Order order = new Order(); order.OrderDate = DateTime.Parse("01/01/1111"); Assert.AreEqual(true, data.CreateOrder(order)); }
public void CanDeleteProductionOrder() { IOrderRepository data = new ProductionOrdersRepository(@"C:\Data\LiveData"); DateTime date = DateTime.Parse("01/01/1111"); List <Order> orders = data.RetrieveOrdersByDate(date); int id = orders.Select(o => o.OrderNumber).Max(); Order order = new Order(); order.OrderDate = DateTime.Parse("01/01/1111"); order.OrderNumber = id; Assert.AreEqual(true, data.DeleteOrder(order)); }
public void CanRetrieveProductionOrder() { IOrderRepository data = new ProductionOrdersRepository(@"C:\Data\LiveData"); Order order = new Order(); order.OrderDate = DateTime.Parse("01/01/1111"); order.CustomerName = "Thommas"; data.CreateOrder(order); Order retrieved = data.RetrieveOrder(order); Assert.AreEqual(order.CustomerName, retrieved.CustomerName); }
public void CanUpdateProductionOrder() { IOrderRepository data = new ProductionOrdersRepository(@"C:\Data\LiveData"); Order order = new Order(); order.OrderDate = DateTime.Parse("01/01/1111"); order.OrderNumber = 3; order.CustomerName = "Thomas!"; Order retrieved = data.RetrieveOrder(order); order.ProductType = "Wooood"; Assert.IsTrue(data.UpdateOrder(order)); }