Beispiel #1
0
        private static IEnumerable <object[]> GetAllCustomers()
        {
            yield return(new object[] { CustomerMockBuilder.Build(address: AddressMockBuilder.BuildGermany(), paysVat: true) });

            yield return(new object[] { CustomerMockBuilder.Build(address: AddressMockBuilder.BuildGermany(), paysVat: false) });

            yield return(new object[] { CustomerMockBuilder.Build(address: AddressMockBuilder.BuildFrance(), paysVat: true) });

            yield return(new object[] { CustomerMockBuilder.Build(address: AddressMockBuilder.BuildFrance(), paysVat: false) });

            yield return(new object[] { CustomerMockBuilder.Build(address: AddressMockBuilder.BuildMontenegro(), paysVat: true) });

            yield return(new object[] { CustomerMockBuilder.Build(address: AddressMockBuilder.BuildMontenegro(), paysVat: false) });
        }
        public void Returns_failure_result_for_VAT_paying_supplier_with_EU_VAT_paying_customer_in_different_country()
        {
            var supplier = SupplierMockBuilder.Build(
                address: AddressMockBuilder.BuildGermany(),
                paysVat: true);

            var customer = CustomerMockBuilder.Build(
                address: AddressMockBuilder.BuildFrance(),
                paysVat: true);

            var actual = _sut.Execute(supplier, customer);

            actual.IsSuccess.Should().BeFalse();
            actual.Value.Should().Be(0);
        }
Beispiel #3
0
        public void Able_to_calculate_VAT_rate_for_VAT_paying_supplier_and_non_VAT_paying_EU_customer_that_do_not_live_in_same_country()
        {
            var supplier = SupplierMockBuilder.Build(
                address: AddressMockBuilder.BuildGermany(VATRate: 0.19),
                paysVat: true);

            var customer = CustomerMockBuilder.Build(
                address: AddressMockBuilder.BuildFrance(VATRate: 0.2),
                paysVat: false);

            var invoice = new Invoice(
                _order,
                _product,
                supplier,
                customer);

            invoice.Amount.VATRate.Should().Be(0.2);
        }