예제 #1
0
        public void TestLastDayOfMonth()
        {
            RecurrenceRuleTime rule = "M(-1)";

            Assert.Equal(TimeInterval.Month, rule.Frequency);
            Assert.Contains(-1, rule.Times);
            Assert.Single(rule.Times);
        }
예제 #2
0
        public void TestSimpleRule(string alias, int count)
        {
            RecurrenceRuleTime rule = alias;

            Assert.Equal(1, rule.Multiplier);
            Assert.Equal(alias, rule.Frequency.Alias);
            Assert.Equal(count, rule.Times.Count);
        }
예제 #3
0
        public void TestDayOfYear()
        {
            RecurrenceRuleTime rule = "DY(34+35)";

            Assert.Equal(TimeInterval.DayOfYear, rule.Frequency);
            Assert.Contains(34, rule.Times);
            Assert.Contains(35, rule.Times);
            Assert.Equal(2, rule.Times.Count);
        }
예제 #4
0
        public void TestDayOfMonth()
        {
            RecurrenceRuleTime rule = "DM(5+15)";

            Assert.Equal(TimeInterval.DayOfMonth, rule.Frequency);
            Assert.Contains(5, rule.Times);
            Assert.Contains(15, rule.Times);
            Assert.Equal(2, rule.Times.Count);
        }
예제 #5
0
        public void TestWeekSet()
        {
            RecurrenceRuleTime rule = "WY(23+35)";

            Assert.Equal(TimeInterval.WeekOfYear, rule.Frequency);
            Assert.Contains(23, rule.Times);
            Assert.Contains(35, rule.Times);
            Assert.Equal(2, rule.Times.Count);
        }
예제 #6
0
        public void TestYearRange()
        {
            RecurrenceRuleTime rule = "Y(2012-2014)";

            Assert.Equal(TimeInterval.Year, rule.Frequency);
            Assert.Contains(2012, rule.Times);
            Assert.Contains(2013, rule.Times);
            Assert.Contains(2014, rule.Times);
            Assert.Equal(3, rule.Times.Count);
        }