示例#1
0
        public void CanDisplayAccount()
        {
            Order               newOrder = new Order();
            OrderManager        manager  = OrderManagerFactory.Builder();
            LookUpOrderResponse response = manager.LookUpOrderList(newOrder);

            Assert.IsNotNull(response.OrderList);
            Assert.IsTrue(response.Success);
        }
        public void TheBeginningOfTheEnd()
        {
            OrderManager manager = OrderManagerFactory.Builder();

            Display();
            Console.WriteLine("   Format needs to be MMDDYEAR");
            Console.Write("   Enter Date: ");
            newOrder.Date = Console.ReadLine();
            Console.WriteLine();
            SuccessOrNot(manager);
            Console.WriteLine("Press any key to continue");
            Console.ReadKey();
            Console.Clear();
        }
示例#3
0
        public void CanEditOrder(string accountNumber, string name, string date, bool expectedResult)
        {
            OrderManager  manager  = OrderManagerFactory.Builder();
            OrderResponse oldOrder = new OrderResponse();
            OrderResponse newOrder = new OrderResponse();

            oldOrder.Order.OrderNumber = accountNumber;
            oldOrder.Order.Date        = date;
            oldOrder = manager.DisplaySingleOrder(oldOrder.Order);
            newOrder.Order.CustomerName = name;
            oldOrder.Order.CustomerName = newOrder.Order.CustomerName;
            oldOrder = manager.WriteEditedOrder(oldOrder.Order);

            Assert.AreEqual(expectedResult, oldOrder.Success);
        }
示例#4
0
        public void CanDelete(string orderNUmber, string orderDate, bool expectedResults)
        {
            OrderManager  manager       = OrderManagerFactory.Builder();
            OrderResponse orderToDelete = new OrderResponse();
            OrderResponse orderList     = new OrderResponse();

            orderToDelete.Order.OrderNumber = orderNUmber;
            orderToDelete.Order.Date        = orderDate;
            orderList.Order.Date            = "10102016";
            orderToDelete = manager.DisplaySingleOrder(orderToDelete.Order);
            manager.DeletingOrder(orderToDelete.Order);
            LookUpOrderResponse response = manager.LookUpOrderList(orderList.Order);

            response.OrderList.Count();
            Assert.AreEqual(expectedResults, response.Success);
        }
示例#5
0
        public void CanAddOrder(string accountNumber, string name, States state, decimal taxRate, ProductType productType, decimal area, decimal perFootCost, decimal labor, decimal materialCost, decimal lanorCost, decimal tax, decimal total, string date, bool expectedResult)
        {
            OrderManager manager = OrderManagerFactory.Builder();
            Order        order   = new Order();

            order.OrderNumber  = accountNumber;
            order.CustomerName = name;
            order.State        = state;
            order.TaxRate      = taxRate;
            order.Product.Type = productType;
            order.Area         = area;
            order.Product.CostPerSquareFoot      = perFootCost;
            order.Product.LaborCostPerSquareFoot = labor;
            order.MaterialCost = materialCost;
            order.LaborCost    = lanorCost;
            order.TaxOfTotal   = tax;
            order.TotalCost    = total;
            order.Date         = date;
            manager.AddOrder(order);
            Assert.AreEqual(expectedResult, order.IsValid);
        }