示例#1
0
        public async Task Should_assume_valid_VAT_number_if_EuVatAssumeValid_setting_is_true()
        {
            _taxSettings.EuVatAssumeValid = true;
            VatNumberStatus vatNumberStatus = (await _taxService.GetVatNumberStatus("GB", "000 0000 00")).status;

            Assert.AreEqual(VatNumberStatus.Valid, vatNumberStatus);
        }
示例#2
0
        public void Can_do_VAT_check()
        {
            //remove? this method requires Internet access

            string    name, address;
            Exception exception;

            VatNumberStatus vatNumberStatus1 = _taxService.DoVatCheck("GB", "523 2392 69",
                                                                      out name, out address, out exception);

            if (exception != null && exception.Message == "MS_UNAVAILABLE")
            {
                throw new IgnoreException("Web Service Unavailable");
            }

            vatNumberStatus1.ShouldEqual(VatNumberStatus.Valid);
            exception.ShouldBeNull();

            VatNumberStatus vatNumberStatus2 = _taxService.DoVatCheck("GB", "000 0000 00",
                                                                      out name, out address, out exception);

            if (exception != null && exception.Message == "MS_UNAVAILABLE")
            {
                throw new IgnoreException("Web Service Unavailable");
            }

            vatNumberStatus2.ShouldEqual(VatNumberStatus.Invalid);
            exception.ShouldBeNull();
        }
示例#3
0
        public void Should_assume_valid_VAT_number_if_EuVatAssumeValid_setting_is_true()
        {
            _taxSettings.EuVatAssumeValid = true;
            string name, address;

            VatNumberStatus vatNumberStatus = _taxService.GetVatNumberStatus("GB", "000 0000 00",
                                                                             out name, out address);

            vatNumberStatus.ShouldEqual(VatNumberStatus.Valid);
        }
示例#4
0
        public void Can_do_VAT_check()
        {
            Exception ex;

            // Check VAT of DB Vertrieb GmbH (Deutsche Bahn).
            VatNumberStatus vatNumberStatus1 = _taxService.DoVatCheck("DE", "814160246", out var _, out var _, out ex);

            ex.ShouldBeNull();
            vatNumberStatus1.ShouldEqual(VatNumberStatus.Valid);

            VatNumberStatus vatNumberStatus2 = _taxService.DoVatCheck("DE", "000000000", out var _, out var _, out ex);

            vatNumberStatus2.ShouldEqual(VatNumberStatus.Invalid);
            ex.ShouldBeNull();
        }
        public void Can_do_VAT_check()
        {
            //remove? this method requires Internet access

            string    name, address;
            Exception exception;

            VatNumberStatus vatNumberStatus1 = _taxService.DoVatCheck("GB", "523 2392 69", out name, out address, out exception);

            exception.ShouldBeNull();
            vatNumberStatus1.ShouldEqual(VatNumberStatus.Valid);

            VatNumberStatus vatNumberStatus2 = _taxService.DoVatCheck("GB", "000 0000 00", out name, out address, out exception);

            vatNumberStatus2.ShouldEqual(VatNumberStatus.Invalid);
            exception.ShouldBeNull();
        }
示例#6
0
 public VatCheckResult(VatNumberStatus status, string vatNumber)
 {
     Status    = status;
     VatNumber = vatNumber;
 }