public void Reset(BaseRecurrency recurrency)
        {
            Reset();
            SetBaseValues(recurrency);

            if (recurrency != null)
            {
                switch (recurrency.GetType())
                {
                case RecurrencyType.Daily:
                    SetDailyValues(recurrency as DailyRecurrency);
                    break;

                case RecurrencyType.Weekly:
                    SetWeeklyValues(recurrency as WeeklyRecurrency);
                    break;

                case RecurrencyType.Monthly:
                    SetMonthlyValues(recurrency as MonthlyRecurrency);
                    break;

                case RecurrencyType.Yearly:
                    SetYearlyValues(recurrency as YearlyRecurrency);
                    break;

                default:
                    throw new ArgumentException("Unknown recurrency type");
                }

                Type = recurrency.GetType();
            }
        }
        public void Reset(BaseRecurrency recurrency)
        {
            Reset();
            SetBaseValues(recurrency);

            if (recurrency != null)
            {
                switch (recurrency.GetType())
                {
                    case RecurrencyType.Daily:
                        SetDailyValues(recurrency as DailyRecurrency);
                        break;
                    case RecurrencyType.Weekly:
                        SetWeeklyValues(recurrency as WeeklyRecurrency);
                        break;
                    case RecurrencyType.Monthly:
                        SetMonthlyValues(recurrency as MonthlyRecurrency);
                        break;
                    case RecurrencyType.Yearly:
                        SetYearlyValues(recurrency as YearlyRecurrency);
                        break;
                    default:
                        throw new ArgumentException("Unknown recurrency type");

                }

                Type = recurrency.GetType();
            }
        }
 private void CheckEquals_Base(RecurrencyInfo info, BaseRecurrency recurrency)
 {
     Assert.AreEqual(recurrency.StartDate, info.StartDate);
     Assert.AreEqual(recurrency.EndDate, info.EndDate);
     Assert.AreEqual(recurrency.Occurrences, info.Occurrences);
 }
 private void SetBaseValues(BaseRecurrency recurrency)
 {
     StartDate   = recurrency.StartDate;
     EndDate     = recurrency.EndDate;
     Occurrences = recurrency.Occurrences;
 }
 public RecurrencyInfo(BaseRecurrency recurrency)
 {
     Reset(recurrency);
 }
 private void SetBaseValues(BaseRecurrency recurrency)
 {
     StartDate = recurrency.StartDate;
     EndDate = recurrency.EndDate;
     Occurrences = recurrency.Occurrences;
 }
 public RecurrencyInfo(BaseRecurrency recurrency)
 {
     Reset(recurrency);
 }