public void WhenParsingAValidScheduleEntry() { var parsed = ScheduleEntry.Parse("12", 0, 24); Assert.IsNotNull(parsed); Assert.IsTrue(parsed.HasValue(12), "The value 12 should be in the parsed schedule"); Assert.IsFalse(parsed.HasValue(18), "The value 18 should not be in the parsed schedule"); }
public void WhenParsingAnInvalidRangeScheduleEntry() { ScheduleEntry parsed = default; Exception catched = default; try { parsed = ScheduleEntry.Parse("[12, 20]", 0, 14); } catch (Exception ex) { catched = ex; } Assert.IsNull(parsed); Assert.IsNotNull(catched); Assert.IsInstanceOfType(catched, typeof(ArgumentException)); }