コード例 #1
0
        public void TestByMonth()
        {
            IRRuleTokenContainer tokenContainer = tokenizer.Tokenize("FREQ=DAILY;BYMONTH=12");

            Assert.AreEqual(2, tokenContainer.RuleCount());
            Assert.NotNull(tokenContainer.GetByMonth());
            Assert.AreEqual(12, tokenContainer.GetByMonth().GetValue());
        }
コード例 #2
0
        public void TestBySetPos()
        {
            IRRuleTokenContainer tokenContainer = tokenizer.Tokenize("FREQ=DAILY;BYSETPOS=10");

            Assert.AreEqual(2, tokenContainer.RuleCount());
            Assert.NotNull(tokenContainer.GetBySetPos());
            Assert.AreEqual(10, (int)tokenContainer.GetBySetPos().GetValue());
        }
コード例 #3
0
        public void TestByDay()
        {
            IRRuleTokenContainer tokenContainer = tokenizer.Tokenize("FREQ=DAILY;BYDAY=MO,TU,WE,SA");

            Assert.AreEqual(2, tokenContainer.RuleCount());
            Assert.NotNull(tokenContainer.GetByDay());
            Assert.AreEqual(4, ((ByDayToken.DayList)tokenContainer.GetByDay().GetValue()).GetDayList().Count);
        }
コード例 #4
0
        public void testByMonthDay()
        {
            IRRuleTokenContainer tokenContainer = tokenizer.Tokenize("FREQ=DAILY;BYMONTHDAY=2");

            Assert.AreEqual(2, tokenContainer.RuleCount());
            Assert.NotNull(tokenContainer.GetByMontDay());
            Assert.AreEqual(2, (int)tokenContainer.GetByMontDay().GetValue());
        }
コード例 #5
0
        public void TestInterval()
        {
            IRRuleTokenContainer tokenContainer = tokenizer.Tokenize("FREQ=DAILY;INTERVAL=1");

            Assert.AreEqual(2, tokenContainer.RuleCount());
            Assert.NotNull(tokenContainer.GetInterval());
            Assert.AreEqual(1, (int)tokenContainer.GetInterval().GetValue());
        }
コード例 #6
0
        public void TestFreq()
        {
            IRRuleTokenContainer tokenContainer = tokenizer.Tokenize("FREQ=DAILY");

            Assert.AreEqual(1, tokenContainer.RuleCount());
            Assert.NotNull(tokenContainer.GetFreq());
            Assert.AreEqual(FreqToken.FreqValue.DAILY, tokenContainer.GetFreq().GetValue());
        }
コード例 #7
0
        public void TestUntil()
        {
            IRRuleTokenContainer tokenContainer = tokenizer.Tokenize("FREQ=DAILY;UNTIL=20181023T220000Z");

            Assert.AreEqual(2, tokenContainer.RuleCount());
            Assert.NotNull(tokenContainer.GetUntil());
            Assert.AreEqual(new DateTime(2018, 10, 23, 22, 0, 0),
                            ((ValueWrapper)tokenContainer.GetUntil().GetValue()).getLocalDateTime());
        }
コード例 #8
0
        public void TestComplex()
        {
            IRRuleTokenContainer tokenContainer = tokenizer.Tokenize("FREQ=YEARLY;BYDAY=TU;BYSETPOS=1;BYMONTH=4;UNTIL=20181023T220000Z");

            Assert.AreEqual(5, tokenContainer.RuleCount());
            Assert.NotNull(tokenContainer.GetFreq());
            Assert.NotNull(tokenContainer.GetByDay());
            Assert.NotNull(tokenContainer.GetBySetPos());
            Assert.NotNull(tokenContainer.GetByMonth());
            Assert.NotNull(tokenContainer.GetUntil());
            Assert.AreEqual(FreqToken.FreqValue.YEARLY, tokenContainer.GetFreq().GetValue());
        }
コード例 #9
0
        public void TestComplexContainer()
        {
            IRRuleTokenContainer tokenContainer = tokenizer.Tokenize("FREQ=YEARLY;BYDAY=TU;BYSETPOS=1;BYMONTH=4;UNTIL=20181023T220000Z");

            Assert.AreEqual(5, tokenContainer.RuleCount());
        }
コード例 #10
0
        public void TestSimpleContainer()
        {
            IRRuleTokenContainer tokenContainer = tokenizer.Tokenize("FREQ=DAILY;INTERVAL=1");

            Assert.AreEqual(2, tokenContainer.RuleCount());
        }