Ejemplo n.º 1
0
        public static IDiscount Create(IMarketingCampaign campaign, IMoney money)
        {
            if (campaign.IsCrazySalesDay())
            {
                return(new DiscountCrazySalesDay());
            }

            if (money.IsMoreThanOneThousand())
            {
                return(new DiscountOneThousand());
            }

            if (money.IsMoreThanOneHundred() && campaign.IsActive())
            {
                return(new DiscountOneHundred());
            }

            return(new DiscountNoDiscount());
        }