Ejemplo n.º 1
0
        public void TestCancelOrder()
        {
            //Arrange
            DataCustomerOrder    dataOrder = new DataCustomerOrder();
            ServiceCustomerOrder order     = new ServiceCustomerOrder();

            // Get the first order in the DB
            order = dataOrder.GetOrder(1);

            // Change the order status to Cancelled
            order.Status = "Cancelled";

            //Act
            dataOrder.UpdateOrder(order);  // Update the order and update the database

            //Assert
            Assert.AreEqual("Cancelled", dataOrder.GetOrder(1).Status);
        }
Ejemplo n.º 2
0
        public void SetPaymentMethodTest()
        {
            //Arrange
            ServiceCustomerOrder order = new ServiceCustomerOrder();
            DataCustomerOrder    dco   = new DataCustomerOrder();
            ServiceCustomerOrder testOrder;

            order.DateOrder     = DateTime.Today;
            order.FinalPrice    = 5000;
            order.Status        = "Test Status";
            order.PaymentMethod = 1;
            order.CustomerId    = 1;
            //Act
            int idOfTestOrder = dco.InsertOrder(order);

            testOrder = dco.GetOrder(idOfTestOrder);

            //Assert
            Assert.IsNotNull(testOrder.PaymentMethod);
        }
Ejemplo n.º 3
0
        public void OrderWithoutDiscount()
        {
            //ARRANGE
            ServiceCustomerOrder order     = new ServiceCustomerOrder();
            DataCustomerOrder    dco       = new DataCustomerOrder();
            ServiceCustomerOrder testOrder = new ServiceCustomerOrder();

            //  Set all attributes except Discount
            order.DateOrder     = DateTime.Today;
            order.FinalPrice    = 1000;
            order.Status        = "Test Status";
            order.PaymentMethod = 1;
            order.CustomerId    = 1;

            //ACT
            int testId = dco.InsertOrder(order);

            testOrder = dco.GetOrder(testId);

            //ASSERT
            Assert.IsNotNull(testOrder);
        }
Ejemplo n.º 4
0
 public ServiceCustomerOrder GetOrder(int customerOrderId)
 {
     return(dataCustomerOrder.GetOrder(customerOrderId));
 }