public void CalculateTaxesForAnOrder_ThrowException_WhenOrderIsNull() { //Arrange var taxCalculator = new TaxJarCalculator(); //Act var result = taxCalculator.CalculateTheTaxesForAnOrder(null); //Assert Assert.Equal("Order is invalid. (Parameter 'order')", result.Exception?.InnerException?.Message); }
public void CalculateTaxesForAnOrder_ThrowException_WhenToCountryIsNull() { //Arrange var taxCalculator = new TaxJarCalculator(); var order = new Order { ToCountry = null }; //Act var result = taxCalculator.CalculateTheTaxesForAnOrder(order); //Assert Assert.Equal("to_country is a required parameter. (Parameter 'ToCountry')", result.Exception?.InnerException?.Message); }
public void CalculateTaxesForAnOrder_ThrowException_WhenCountryIsUSorCAToStateIsNull() { //Arrange var taxCalculator = new TaxJarCalculator(); var order = new Order { ToCountry = "US", Shipping = 1.5f }; //Act var result = taxCalculator.CalculateTheTaxesForAnOrder(order); //Assert Assert.Equal("to_state is a required parameter when country is US or CA. (Parameter 'ToState')", result.Exception?.InnerException?.Message); }