public void GetPattern_Yearly()
 {
     var info = new RecurrencyInfo
     {
         Type = RecurrencyType.Yearly,
         StartDate = new DateTime(2011, 2, 01),
         Occurrences = 6,
         YearlyInterval = 2,
         YearlyType = MonthlyType.Weekday,
         YearlyDayOfWeek = DayOfWeek.Tuesday,
         YearlyDayIndex = DayIndex.Third,
         YearlyMonth = 3
     };
     var pattern = info.GetPattern();
     Assert.AreEqual('Y', pattern[0]);
 }
 public void GetPattern_Daily()
 {
     var info = new RecurrencyInfo { StartDate = new DateTime(2011, 10, 7), Occurrences = 156, DailyType = DailyType.EveryXDays, DailyInterval = 50, Type = RecurrencyType.Daily };
     var pattern = info.GetPattern();
     Assert.AreEqual('D', pattern[0]);
 }
 public void GetPattern_Weekly()
 {
     var info = new RecurrencyInfo
     {
         Type = RecurrencyType.Weekly,
         StartDate = new DateTime(2011, 5, 12),
         EndDate = new DateTime(2011, 10, 6),
         WeeklyInterval = 50
     };
     var pattern = info.GetPattern();
     Assert.AreEqual('W', pattern[0]);
 }
 public ActionResult Index(RecurrencyInfo info)
 {
     // do something with the info object such as save the pattern to database
     return RedirectToAction("Range", new { pattern = info.GetPattern() });
 }