public async Task GetTaxRate_WhenUnsuccessful_ReturnsError() { var taxService = new TaxService(); var res = await taxService.GetTaxRate(TaxJarCalculator_UnitTests.MakeInvalidRateRequest()); Assert.IsFalse(res.success); Assert.IsNotNull(res.message); Assert.IsNull(res.rate); }
public async Task GetTaxRate_WhenSuccessful_ReturnsRate() { var taxService = new TaxService(); var res = await taxService.GetTaxRate(TaxJarCalculator_UnitTests.MakeValildRateRequest()); Assert.IsTrue(res.success); Assert.IsTrue(string.IsNullOrEmpty(res.message)); Assert.IsNotNull(res.rate); Assert.IsTrue(res.rate.CombinedRate > 0); }
public async Task CalculateTax_WhenSuccessful_ReturnsTax() { var taxService = new TaxService(); var res = await taxService.CalculateTax(TaxJarCalculator_UnitTests.MakeValidTaxRequest()); Assert.IsTrue(res.success); Assert.IsTrue(string.IsNullOrEmpty(res.message)); Assert.IsNotNull(res.tax); Assert.IsTrue(res.tax.AmountToCollect > 0); }