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 void GetPattern_Monthly()
        {
            var info = new RecurrencyInfo
            {
                Type             = RecurrencyType.Monthly,
                StartDate        = new DateTime(2011, 2, 01),
                Occurrences      = 6,
                MonthlyInterval  = 2,
                MonthlyType      = MonthlyType.Weekday,
                MonthlyDayOfWeek = DayOfWeek.Tuesday,
                MonthlyDayIndex  = DayIndex.Third
            };
            var pattern = info.GetPattern();

            Assert.AreEqual('M', pattern[0]);
        }
Esempio n. 4
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() }));
 }