public void CanRestrieveTaxInformationTest() { TaxManager manager = TaxManagerFactory.Create(); TaxLookUpResponse response = new TaxLookUpResponse(); response = manager.TaxLookUp("OH"); Assert.IsTrue(response.Success); Assert.AreEqual("OH", response.TaxInformation.StateAbbreviation); }
public static bool StateValidation(string input) { bool result = false; TaxLookUpResponse taxResponse = TaxManagerFactory.Create().TaxLookUp(input); if (taxResponse.Success) { result = true; } return(result); }
public static void Field(Order order) { TaxLookUpResponse taxResponse = TaxManagerFactory.Create().TaxLookUp(order.State); ProductInformationResponse productResponse = ProductManagerFactory.Create().ProductInformation(order.ProductType); order.TaxRate = Math.Round(taxResponse.TaxInformation.TaxRate, 2); order.CostPerSquareFoot = Math.Round(productResponse.Product.CostPerSquareFoot, 2); order.LaborCostPerSquare = Math.Round(productResponse.Product.LaborCostPerSquareFoot, 2); order.MaterialCost = Math.Round(order.Area * order.CostPerSquareFoot, 2); order.LaborCost = Math.Round(order.Area * order.LaborCostPerSquare, 2); order.Tax = Math.Round(((order.MaterialCost + order.LaborCost) * (order.TaxRate / 100)), 2); order.Total = Math.Round((order.MaterialCost + order.LaborCost + order.Tax), 2); }
public TaxLookUpResponse TaxLookUp(string stateAbbreviation) { TaxLookUpResponse response = new TaxLookUpResponse(); response.TaxInformation = _taxRepository.RetrieveTaxInfo(stateAbbreviation); if (response.TaxInformation == null) { response.Success = false; response.Message = $"There was no Tax Information found {stateAbbreviation}. Contact IT."; } else { response.Success = true; } return(response); }