public async void TaxJarGetTaxableAmount(string tocountry, string tozip, string tostate, double shipping, string fromzip, string fromcountry, string fromcity, string fromstate, string fromstreet, double amount) { ReqTaxes reqTaxes = new ReqTaxes() { ToCountry = tocountry, ToZip = tozip, ToState = tostate, Shipping = shipping, FromZip = fromzip, FromCountry = fromcountry, FromCity = fromcity, FromState = fromstate, FromStreet = fromstreet }; TaxJar taxJar = new TaxJar(); // Not getting right result from post request? Seems it's picking up the get request rate. Weird. Assert.Equal(41.03, await taxJar.GetTaxableAmount(reqTaxes)); }
public async void TaxServiceGetTaxableAmount(string tocountry, string tozip, string tostate, double shipping, string fromzip, string fromcountry, string fromcity, string fromstate, string fromstreet, double amount) { ReqTaxes reqTaxes = new ReqTaxes() { ToCountry = tocountry, ToZip = tozip, ToState = tostate, Shipping = shipping, FromZip = fromzip, FromCountry = fromcountry, FromCity = fromcity, FromState = fromstate, FromStreet = fromstreet }; taxCalculator.Setup(x => x.GetTaxableAmount(reqTaxes)).Returns(Task.FromResult(41.03)); TaxCalculator taxService = new TaxCalculator(taxCalculator.Object); Assert.Equal(41.03, await taxService.GetTaxableAmount(reqTaxes)); }