Esempio n. 1
0
        public async Task CalculateTax_WhenUnsuccessful_ReturnsError()
        {
            var taxJar = new TaxJarCalculator();
            var res    = await taxJar.CalculateTax(MakeInvalidTaxRequest());

            Assert.IsFalse(res.success);
            Assert.IsNotNull(res.message);
            Assert.IsNull(res.tax);
        }
Esempio n. 2
0
        public async Task CalculateTax_WhenSuccessful_ReturnsTax()
        {
            var taxJar = new TaxJarCalculator();
            var res    = await taxJar.CalculateTax(MakeValidTaxRequest());

            Assert.IsTrue(res.success);
            Assert.IsTrue(string.IsNullOrEmpty(res.message));
            Assert.IsNotNull(res.tax);
            Assert.IsTrue(res.tax.AmountToCollect > 0);
        }