Esempio n. 1
0
        public void GetTaxRateNullRequestTest()
        {
            string taxRateApiendpoint = "https://api.taxjar.com/v2/rates";
            string apikey             = "5da2f821eee4035db4771edab942a4cc";

            Calculators.TaxJar taxJar = new Calculators.TaxJar(apikey, "", taxRateApiendpoint);
            try
            {
                TaxJarRateResponse result = taxJar.GetTaxRate(null);
                Assert.Fail("Should throw exception");
            }
            catch (Exception ex)
            {
                Assert.IsNotNull(ex);
            }
        }
Esempio n. 2
0
        public void GetTaxRateBadRequestNoZipTest()
        {
            string            taxRateApiendpoint = "https://api.taxjar.com/v2/rates";
            string            apikey             = "5da2f821eee4035db4771edab942a4cc";
            TaxJarRateRequest taxRateRequest     = new TaxJarRateRequest
            {
                Street  = "312 Hurricane Lane",
                City    = "Williston",
                State   = "VT",
                Country = "US"
            };

            Calculators.TaxJar taxJar = new Calculators.TaxJar(apikey, "", taxRateApiendpoint);
            try
            {
                TaxJarRateResponse result = taxJar.GetTaxRate(taxRateRequest);
                Assert.Fail("Should throw exception");
            }
            catch (Exception ex)
            {
                Assert.IsNotNull(ex);
            }
        }