Exemplo n.º 1
0
        public void Can_Validate_A_Address_Using_The_Address_Validate_Api()
        {
            //// Arrange
            var address = new ValidatableAddress()
            {
                Line1 = "114 W. Magnolia St.",
                Line2 = "Suite 300",
                City = "Bellingham",
                Region = "WA",
                PostalCode = "98225",
                Country = "US"
            };

            //// Act
            var result = this.AvaTaxService.ValidateTaxAddress(address);

            //// Assert
            Assert.NotNull(result);
            Assert.IsTrue(result.ResultCode == SeverityLevel.Success);
            Assert.IsNotNullOrEmpty(result.Address.Line1);
        }
Exemplo n.º 2
0
        public void Can_Get_A_Result_From_The_Api()
        {
            //// Arrange
            var address = new ValidatableAddress()
                              {
                                  Line1 = "114 W. Magnolia St.",
                                  Line2 = "Suite 300",
                                  City = "Bellingham",
                                  Region = "WA",
                                  PostalCode = "98225",
                                  Country = "US"
                              };


            var requestUrl = ((AvaTaxService)this.AvaTaxService).GetApiUrl("address", "validate") + "?" + address.AsApiQueryString();

            //// Act
            var response = ((AvaTaxService)this.AvaTaxService).GetResponse(requestUrl);

            //// Assert
            Assert.NotNull(response);
            Console.Write(response);
        }