public void GetXElement_SetName_ReturnCorrectXml() { Schedule sc = new Schedule(); sc.Name = "Schedule1"; var element = sc.GetXElement(); Assert.IsNotNull(element.Attribute(Schedule.CN_NAME)); Assert.IsTrue(element.Attribute(Schedule.CN_NAME).Value == sc.Name); }
public void GetXElement_SetIsActiveTrue_ReturnCorrectXml() { Schedule sc = new Schedule(); sc.Name = "Schedule1"; sc.IsActive = true; var element = sc.GetXElement(); Assert.IsNotNull(element.Attribute(Schedule.CN_IS_ACTIVE)); Assert.IsTrue(bool.Parse(element.Attribute(Schedule.CN_IS_ACTIVE).Value)); }
public void GetXElement_SetDescription_ReturnCorrectXml() { Schedule sc = new Schedule(); sc.Name = "Schedule1"; sc.Description = "Description"; var element = sc.GetXElement(); Assert.IsNotNull(element.Attribute(Schedule.CN_DESCRIPTION)); Assert.IsTrue(element.Attribute(Schedule.CN_DESCRIPTION).Value == sc.Description); }
public void GetXElement_SetStartOnNull_ReturnCorrectXml() { Schedule sc = new Schedule(); sc.Name = "Schedule1"; sc.StartOn = null; var element = sc.GetXElement(); Assert.IsNull(element.Attribute(Schedule.CN_START_ON)); }
public void GetXElement_SetDailyFrecuencyOneTimePerDay_ReturnsCorrectXml() { Schedule schedule = new Schedule(); schedule.Name = "name"; schedule.DailyFrecuency = new DailyFrecuencyOneTimePerDay(); var element = schedule.GetXElement(); Assert.IsNotNull(element.Elements(DailyFrecuencyOneTimePerDay.CN_ONE_TIME_PER_DAY)); }
public void GetXElement_SetPatternWeekly_ReturnsCorrectXml() { Schedule schedule = new Schedule(); schedule.Name = "name"; schedule.Pattern = new WeeklyPattern(); var element = schedule.GetXElement(); Assert.IsNotNull(element.Elements(WeeklyPattern.cn_WeeklyPattern)); }
public void GetXElement_SetPatternDaily_ReturnsCorrectXml() { Schedule schedule = new Schedule(); schedule.Name = "name"; schedule.Pattern = new DailyPattern(); var element = schedule.GetXElement(); Assert.IsNotNull(element.Element(DailyPattern.CN_DAILY_PATTERN)); }
public void GetXElement_SetEndOnValue_ReturnCorrectXml() { Schedule sc = new Schedule(); sc.Name = "Schedule1"; sc.EndOn = DateTime.Now; var element = sc.GetXElement(); Assert.IsNotNull(element.Attribute(Schedule.CN_END_ON)); Assert.IsTrue(sc.EndOn == DateTime.Parse(element.Attribute(Schedule.CN_END_ON).Value)); }