public void AddOrderTest()
        {
            var manager = new OrderManager();
            var newOrder = new Order()
            {
                Area = 10,
                CostPerSquareFoot = 5.15M,
                LaborCostPerSquareFoot = 4.75M,
                Name = "Nick",
                OrderNumber = 0,
                ProductType = "Wood",
                StateAbbr = "PA",
                TaxRate = 6.75M,
            };

            var order = manager.AddOrder(newOrder);

            Assert.AreEqual("Nick", newOrder.Name);
        }
        public void Execute()
        {
            OrderManager manager = new OrderManager();
            Order newOrder = new Order();

            newOrder.Name = GetCustomerName();

            Tax newTax = GetState();
            Product newProduct = GetProductType();

            newOrder.Area = GetArea();
            newOrder.StateAbbr = newTax.StateAbbr;
            newOrder.TaxRate = newTax.TaxRate;
            newOrder.ProductType = newProduct.ProductType;
            newOrder.CostPerSquareFoot = newProduct.CostPerSqFt;
            newOrder.LaborCostPerSquareFoot = newProduct.LaborCostPerSqFt;

            Console.Clear();
            Console.WriteLine("New order information:\n");
            Console.WriteLine("{0, -9} - Name\n{1, -9} - State\n{2, -9} - Material\n{3, -9} - Area\n",
                newOrder.Name, newOrder.StateAbbr, newOrder.ProductType, newOrder.Area);

            if (!GetConfirmation())
                return;

            var response = manager.AddOrder(newOrder);

            if (response.Success)
            {
                Console.Clear();
                Console.WriteLine(response.Message);
                PrintNewOrder(response.Data);
            }
            else
            {
                Console.Clear();
                Console.WriteLine("Something happened when trying to add the order.");
                Console.WriteLine(response.Message);
            }

            Console.Write("Press any key to return to the menu...");
            Console.ReadKey();
        }
        public void AddOrderComputationTest()
        {
            var manager = new OrderManager();
            var newOrder = new Order()
            {
                Area = 10,
                CostPerSquareFoot = 5.15M,
                LaborCostPerSquareFoot = 4.75M,
                Name = "nick",
                OrderNumber = 0,
                ProductType = "Wood",
                StateAbbr = "PA",
                TaxRate = 6.75M,
            };

            var order = manager.AddOrder(newOrder);

            Assert.AreEqual(47.5M, newOrder.LaborCost);
            Assert.AreEqual(51.5M, newOrder.MaterialCost);
            Assert.AreEqual(105.6825, newOrder.TotalCost);
            Assert.AreEqual(6.6825, newOrder.TaxCost);
        }