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 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); }
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); }