public void ValidDaily()
        {
            string               rule      = "FREQ=DAILY;UNTIL=20181015;";
            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;UNTIL=20181015;", ruleResult);
        }
Beispiel #2
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);
        }
        public void EmptyProps()
        {
            string rule = converter.Convert(null);

            Assert.AreEqual(true, converter.HasError);
            Assert.AreEqual("Properties are null", converter.ErrorMessage);
            Assert.AreEqual(string.Empty, rule);
        }
Beispiel #4
0
        public void EmptyRule()
        {
            string               rule      = "";
            DateTime             startDate = new DateTime(2018, 09, 01, 10, 0, 0);
            RecurrenceProperties props     = converter.Convert(rule, startDate);

            Assert.AreEqual(true, converter.HasError);
            Assert.AreEqual("Rule is empty", converter.ErrorMessage);
            Assert.AreEqual(null, props);
        }