public void GetTaxRate_TaxJar_ShortCAZipCode_ReturnsArgumentException()
        {
            //Arrange
            var rateRequest   = new GetTaxRateRequest("V5K", "CA", "Vancouver", null);
            var taxjarService = new TaxJar_Calculator("https://api.taxjar.com/v2/");

            Assert.ThrowsException <System.ArgumentException>(() => taxjarService.GetTaxRate(rateRequest));
        }
        public void GetTaxRate_TaxJar_MissingCountryCode_ReturnsArgumentException()
        {
            //Arrange
            var rateRequest   = new GetTaxRateRequest("32821", "", "Orlando", null);
            var taxjarService = new TaxJar_Calculator("https://api.taxjar.com/v2/");

            Assert.ThrowsException <System.ArgumentException>(() => taxjarService.GetTaxRate(rateRequest));
        }
        public void GetTaxRate_TaxJar_EU_ProperBody_ReturnsCombinedRateAsDouble()
        {
            //Arrange
            var    rateRequest          = new GetTaxRateRequest("00150", "FI", "Helsinki", null);
            var    taxjarService        = new TaxJar_Calculator("https://api.taxjar.com/v2/");
            double expectedCombinedRate = 0.24;
            var    taxjarResponse       = taxjarService.GetTaxRate(rateRequest);

            Assert.AreEqual(expectedCombinedRate, taxjarResponse, 0.001, "Tax Rate is different, not an error");
        }
        public void GetTaxRate_TaxJar_WithProperRequestBody_ReturnsCombinedRateAsDouble()
        {
            //Arrange
            var    rateRequest          = new GetTaxRateRequest("32821", "US", "Orlando", null);
            var    taxjarService        = new TaxJar_Calculator("https://api.taxjar.com/v2/");
            double expectedCombinedRate = 0.065;

            var taxjarResponse = taxjarService.GetTaxRate(rateRequest);

            Assert.AreEqual(expectedCombinedRate, taxjarResponse, 0.001, "Tax Rate is different, not an error");
        }