Example #1
0
        public void Valid1()
        {
            string               rule      = "FREQ=MONTHLY;BYMONTHDAY=1;";
            DateTime             startDate = new DateTime(2018, 09, 01, 10, 0, 0);
            RecurrenceProperties props     = parser.Convert(rule, startDate);

            string ruleResult = converter.Convert(props);

            Assert.AreEqual("FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=1;", ruleResult);
        }
Example #2
0
        public void ValidCountDaily()
        {
            string               rule      = "FREQ=DAILY;COUNT=2;";
            DateTime             startDate = new DateTime(2018, 09, 01, 10, 0, 0);
            RecurrenceProperties props     = parser.Convert(rule, startDate);

            string ruleResult = converter.Convert(props);

            Assert.AreEqual("FREQ=DAILY;INTERVAL=1;COUNT=2;", ruleResult);
        }
Example #3
0
        public void InValidEmpty()
        {
            string               rule      = "FREQ=WEEKLY;INTERVAL;";
            DateTime             startDate = new DateTime(2018, 09, 01, 10, 0, 0);
            RecurrenceProperties props     = parser.Convert(rule, startDate);

            Assert.AreEqual(true, parser.HasError);
            StringAssert.Contains("INTERVAL has non valid value ", parser.ErrorMessage);
        }