Exemple #1
0
        public void GetTheTaxRatesForALocation_Should_ThrowException_WhenZipCodeIsNull()
        {
            //Arrange
            string zipCode       = "";
            var    taxCalculator = new TaxJarCalculator();

            //Act
            var result = taxCalculator.GetTheTaxRatesForALocation(zipCode, null, null, null, null);

            //Assert
            Assert.Equal("Zip code is required. (Parameter 'zip')", result.Exception?.InnerException?.Message);
        }
Exemple #2
0
        public void GetTheTaxRatesForALocation_Should_ThrowException_WhenCountryCodeIsNotEqual2Characters()
        {
            //Arrange
            string zipCode       = "99010";
            string country       = "USA";
            var    taxCalculator = new TaxJarCalculator();

            //Act
            var result = taxCalculator.GetTheTaxRatesForALocation(zipCode, country, null, null, null);

            //Assert
            Assert.Equal("Country code should be 2 characters. (Parameter 'country')", result.Exception?.InnerException?.Message);
        }
Exemple #3
0
        public void GetTheTaxRatesForALocation_Should_ThrowException_WhenZipCodeIsInAWrongFormatForCA()
        {
            //Arrange
            string zipCode       = "V5K0AX1";
            string country       = "CA";
            var    taxCalculator = new TaxJarCalculator();

            //Act
            var result = taxCalculator.GetTheTaxRatesForALocation(zipCode, country, null, null, null);

            //Assert
            Assert.Equal("Zip code format for CA is not correct. (Parameter 'validZipCode')", result.Exception?.InnerException?.Message);
        }