Exemple #1
0
        public void Able_to_calculate_VAT_rate_for_non_VAT_paying_non_EU_supplier(Customer customer)
        {
            var supplier = SupplierMockBuilder.Build(
                address: AddressMockBuilder.BuildMontenegro(),
                paysVat: false);

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

            invoice.Amount.VATRate.Should().Be(0);
        }
Exemple #2
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_non_EU_non_VAT_paying_customer_in_different_country()
        {
            var supplier = SupplierMockBuilder.Build(
                address: AddressMockBuilder.BuildGermany(),
                paysVat: true);

            var customer = CustomerMockBuilder.Build(
                address: AddressMockBuilder.BuildMontenegro(),
                paysVat: false);

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

            actual.IsSuccess.Should().BeFalse();
            actual.Value.Should().Be(0);
        }
Exemple #4
0
        public void Returns_success_result_for_VAT_paying_supplier_with_non_EU_customer()
        {
            var supplier = SupplierMockBuilder.Build(
                address: AddressMockBuilder.BuildGermany(),
                paysVat: true);

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

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

            actual.IsSuccess.Should().BeTrue();
            actual.Value.Should().Be(0);
        }
Exemple #5
0
        public void Able_to_create_instance()
        {
            var expectedFullName = "John Smith";
            var expectedAddress  = AddressMockBuilder.BuildMontenegro();
            var expectedPaysVAT  = true;

            var actual = new Individual(
                expectedFullName,
                expectedAddress,
                expectedPaysVAT);

            actual.Id.Should().NotBeEmpty();
            actual.FullName.Should().Be(expectedFullName);
            actual.Address.Should().Be(expectedAddress);
            actual.PaysVAT.Should().Be(expectedPaysVAT);
            actual.InEU.Should().Be(false);
        }
Exemple #6
0
        public void Able_to_create_instance_with_persistence_constructor()
        {
            var expectedId       = Guid.NewGuid();
            var expectedFullName = "John Smith";
            var expectedAddress  = AddressMockBuilder.BuildMontenegro();
            var expectedPaysVAT  = true;

            var actual = new Individual(
                expectedId,
                expectedFullName,
                expectedAddress,
                expectedPaysVAT);

            actual.Id.Should().Be(expectedId);
            actual.FullName.Should().Be(expectedFullName);
            actual.Address.Should().Be(expectedAddress);
            actual.PaysVAT.Should().Be(expectedPaysVAT);
            actual.InEU.Should().Be(false);
        }