Beispiel #1
0
        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));
        }
Beispiel #2
0
        public void EditNotNewOrder()
        {
            var order = new Order();

            order.StartProcessing(DateTime.Today);
            var orderEngine = new OrderEngine(ConnectionString, Provider);
            var orderId     = orderEngine.CreateOrder(order);

            orderEngine.EditOrder(orderId, order);
        }
Beispiel #3
0
        public void DeleteDeliveredOrder()
        {
            var order       = new Order();
            var orderEngine = new OrderEngine(ConnectionString, Provider);
            var newOrderId  = orderEngine.CreateOrder(order);

            order.StartProcessing(DateTime.Today);
            order.Deliver(DateTime.Today + TimeSpan.FromDays(1));
            orderEngine.EditOrder(newOrderId, order);
            orderEngine.DeleteOrder(newOrderId);
        }
Beispiel #4
0
        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));
        }
Beispiel #5
0
        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));
        }