Beispiel #1
0
        public void Able_to_create_success_result()
        {
            var actual = VATRateCalculationResult.Success(0.5);

            actual.IsSuccess.Should().BeTrue();
            actual.Value.Should().Be(0.5);
        }
Beispiel #2
0
        public VATRateCalculationResult Execute(
            Supplier supplier, Customer customer)
        {
            if (supplier.PaysVAT && !customer.InEU)
            {
                return(VATRateCalculationResult.Success(0));
            }

            return(VATRateCalculationResult.Failure());
        }
        public VATRateCalculationResult Execute(
            Supplier supplier, Customer customer)
        {
            if (supplier.PaysVAT && customer.Address.Country == supplier.Address.Country)
            {
                var value = customer.Address.Country.VATRate;
                return(VATRateCalculationResult.Success(value));
            }

            return(VATRateCalculationResult.Failure());
        }