Ejemplo n.º 1
0
 public bool IsSatisfiedBy(Screening screening)
 {
     return
         (screening.GetStartTime().DayOfWeek == m_DayOfWeek &&
          m_StartTime.CompareTo(screening.GetStartTime().ToLocalTime()) <= 0 &&
          m_EndTime.CompareTo(screening.GetStartTime().ToLocalTime()) >= 0);
 }
Ejemplo n.º 2
0
        public Money CalculateDiscountAmount(Screening screening)
        {
            if (m_Conditions is null)
            {
                return(Money.Zero);
            }

            foreach (var condition in m_Conditions)
            {
                if (condition.IsSatisfiedBy(screening))
                {
                    return(GetDiscountAmount(screening));
                }
            }

            return(Money.Zero);
        }
Ejemplo n.º 3
0
 protected abstract Money GetDiscountAmount(Screening screening);