public void StateDoesNotChangeIfNull()
        {
            string           input       = "";
            Response         response    = new Response();
            OrderRepository  OrderRepo   = new OrderRepository();
            EditOrderManager EditManager = new EditOrderManager(OrderRepo);

            EditManager.OrderToEdit.State = States.OH;
            response = EditManager.ValidateState(input);
            Assert.AreEqual(response.Success, true);
            Assert.AreEqual(EditManager.NewState, States.OH);
        }
        public void TaxRateUpdatesCorrectly(string newState)
        {
            OrderRepository   OrderRepo   = new OrderRepository();
            EditOrderManager  EditManager = new EditOrderManager(OrderRepo);
            TaxRateRepository TaxRateRepo = new TaxRateRepository();



            //this will update the "new state" field after called
            EditManager.ValidateState(newState);
            EditManager.OrderToEdit.TaxRate = 1;
            EditManager.CalculateNewTaxRate();
            TaxRate newTestTaxRate = EditManager.TaxRateRepo.TaxRateList.Find(t => t.StateAbbreviation == newState);
            decimal rate           = newTestTaxRate.Rate;

            Assert.AreEqual(EditManager.NewTaxRate, rate);
        }
        public static void TaxAndTotalUpdatesCorrectly(string testState)
        {
            OrderRepository   OrderRepo   = new OrderRepository();
            EditOrderManager  EditManager = new EditOrderManager(OrderRepo);
            TaxRateRepository TaxRateRepo = new TaxRateRepository();

            EditManager.OrderToEdit.Product                        = new Product();
            EditManager.OrderToEdit.Product.ProductType            = "Carpet";
            EditManager.OrderToEdit.Product.CostPerSquareFoot      = 2.25M;
            EditManager.OrderToEdit.Product.LaborCostPerSquareFoot = 2.10M;
            EditManager.OrderToEdit.Area        = 200M;
            EditManager.OrderToEdit.ProductType = "Carpet";
            EditManager.OrderToEdit.State       = States.OH;
            EditManager.NewArea = 200M;
            //sets new state
            EditManager.ValidateState(testState);
            //sets Taxrate
            EditManager.CalculateNewTaxRate();
            EditManager.ValidateProduct("");
            EditManager.CalculateNewLaborCost();
            EditManager.CalculateNewMaterialCost();
            EditManager.CalculateNewTax();
            TaxRate testRate    = TaxRateRepo.TaxRateList.Find(x => x.StateAbbreviation.Contains(testState));
            decimal rate        = testRate.Rate;
            decimal expectedTax = (EditManager.NewMaterialCost + EditManager.NewLaborCost) * (rate / 100);

            Assert.AreEqual(expectedTax, EditManager.NewTax);

            EditManager.CalculateNewTotal();

            decimal expectedTotal = EditManager.NewMaterialCost + EditManager.NewLaborCost + expectedTax;

            Assert.AreEqual(expectedTotal, EditManager.NewTotal);


            //what was the old tax, what is the new Tax
        }